From bf31a4d23d209d90a3a7e671e9db21bf15fabf3c Mon Sep 17 00:00:00 2001 From: chewingbever Date: Fri, 23 Oct 2020 09:45:55 +0200 Subject: [PATCH] NERDTree improvements; more plugins --- coc-settings.json | 25 +++++++++++++++++++++++++ ftplugin/python.vim | 4 ++-- init.vim | 4 ++++ init/git-fugitive.vim | 2 +- init/nerdtree.vim | 19 +++++++++++++++++-- init/plugins.vim | 13 ++++++++++++- init/settings.vim | 8 +------- init/tagbar.vim | 4 ++-- 8 files changed, 64 insertions(+), 15 deletions(-) diff --git a/coc-settings.json b/coc-settings.json index e69de29..e708ab4 100644 --- a/coc-settings.json +++ b/coc-settings.json @@ -0,0 +1,25 @@ +{ + "languageserver": { + "ccls": { + "command": "ccls", + "filetypes": [ + "c", + "cpp", + "objc", + "objcpp" + ], + "rootPatterns": [ + ".ccls", + "compile_commands.json", + ".vim/", + ".git/", + ".hg/" + ], + "initializationOptions": { + "cache": { + "directory": "/tmp/ccls" + } + } + } + } +} diff --git a/ftplugin/python.vim b/ftplugin/python.vim index 95a9868..ccc3bc8 100644 --- a/ftplugin/python.vim +++ b/ftplugin/python.vim @@ -1,6 +1,6 @@ " Show a visual market at text width 80 -setlocal colorcolumn=80 +setlocal colorcolumn=81 " Auto-wrap lines -setlocal textwidth=79 +setlocal textwidth=80 diff --git a/init.vim b/init.vim index b98c55a..b32e686 100644 --- a/init.vim +++ b/init.vim @@ -15,3 +15,7 @@ let g:maplocalleader = "\" " Without the !, runtime only sources the first file in the list, " instead of all runtime! init/*.vim + +" This sources a .vim/local.vim file in the current directory, if it exists. +" This allows for project-specific settings, such as on-write autocmd's etc. +silent! source .vim/local.vim diff --git a/init/git-fugitive.vim b/init/git-fugitive.vim index 7a1f145..f4737dc 100644 --- a/init/git-fugitive.vim +++ b/init/git-fugitive.vim @@ -6,7 +6,7 @@ nnoremap gc :Gcommit " Push nnoremap gp :Gpush " Show diffs -nnoremap gd :Gdiffsplit! +nnoremap gd :Gvdiffsplit! " Easily resolve merges nnoremap gh :diffget //2 nnoremap gl :diffget //3 diff --git a/init/nerdtree.vim b/init/nerdtree.vim index 3c27378..8a1c427 100644 --- a/init/nerdtree.vim +++ b/init/nerdtree.vim @@ -1,3 +1,18 @@ -let NERDTreeIgnore = ['\.vim$', '__pycache__', '\.pytest_cache', 'venv', '.*\.egg-info', 'dist', 'build', '\.eggs', - \ '.git'] +" Vim +" Other IDEs +" Python +" Java +" Git +" Stack & Haskell +" CMake +" Non-text files +let NERDTreeIgnore = [ + \ '^\.vim$', + \ '^\.vscode$', '.*\.code-workspace$', '^\.idea$', + \ '^__pycache__$', '^\.pytest_cache$', '^venv$', '\.egg-info$', '^dist$', '^build$', '^\.eggs$', + \ '^out$', + \ '^\.git$', + \ '^\.stack-work$', '\.lock$', + \ '^CMakeFiles$', '^CMakeCache.txt$', + \ '.pdf$'] let NERDTreeShowHidden = 1 diff --git a/init/plugins.vim b/init/plugins.vim index 8c69264..6cdf27f 100644 --- a/init/plugins.vim +++ b/init/plugins.vim @@ -6,7 +6,7 @@ call plug#begin('~/.config/nvim/plugged') " definitions easily. Plug 'ludovicchabant/vim-gutentags', { 'commit': '31c0ead' } -" Fuzzy file search +" Plug 'Shougo/denite.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'ctrlpvim/ctrlp.vim' " Git client within Vim @@ -38,4 +38,15 @@ Plug 'michaeljsmith/vim-indent-object' Plug 'scrooloose/nerdtree' +" Toml syntax highlighting +Plug 'cespare/vim-toml' + +" Auto-bracket pairs +Plug 'jiangmiao/auto-pairs' + +" Auto-align text +Plug 'godlygeek/tabular' + +Plug 'neovimhaskell/haskell-vim' + call plug#end() diff --git a/init/settings.vim b/init/settings.vim index e6afa41..a32a5cd 100644 --- a/init/settings.vim +++ b/init/settings.vim @@ -3,7 +3,7 @@ " Without this, some colorschemes (including mine) don't work properly. set termguicolors " Set colorscheme -colorscheme flattened_dark +colorscheme tokyonight " Line numbers " I use the combination of absolute and relative line numbers. On the @@ -37,12 +37,6 @@ set smartcase " Don't hightlight search results after search is finished set nohlsearch -function SetDirs() - let filedir = expand('%:h') - let &l:directory = filedir . '/.vim/swap' - let &l:undodir = filedir . '/.vim/undo' -endfunction - " autocmd BufReadPre * call SetDirs() " Turn on swap files set swapfile diff --git a/init/tagbar.vim b/init/tagbar.vim index 998c803..a161472 100644 --- a/init/tagbar.vim +++ b/init/tagbar.vim @@ -15,7 +15,7 @@ let g:tagbar_autoshowtag = 1 let g:no_status_line = 1 " Open tagbar when opening certain language types -autocmd BufNewFile,BufReadPre *.py,*.java,*.rs,*.cpp,*.c TagbarOpen +autocmd BufNewFile,BufReadPre *.py,*.java,*.rs,*.cpp,*.c,*.r TagbarOpen " Explicitly close tagbar for these types -autocmd BufNewFile,BufReadPre *.md,*.vim,*.txt,*.yaml,*.yml,*.rst TagbarClose +autocmd BufNewFile,BufReadPre *.txt,*.rst TagbarClose