nvim: init.vim: Miscellaneous cleanups

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2019-12-01 21:31:18 +05:30
parent bdae1542b0
commit 1e5b19d740

View file

@ -18,8 +18,6 @@ Plug 'bling/vim-airline'
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
" Manage Project sessions " Manage Project sessions
Plug 'thaerkh/vim-workspace' Plug 'thaerkh/vim-workspace'
" Explore filesystem
Plug 'scrooloose/nerdtree'
" Commenter " Commenter
Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdcommenter'
" Theme " Theme
@ -74,15 +72,24 @@ Plug 'vim-erlang/vim-erlang-compiler'
" Miscellaneous " Miscellaneous
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat' Plug 'tpope/vim-repeat'
Plug 'editorconfig/editorconfig-vim'
Plug 'tpope/vim-eunuch' Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-sleuth'
Plug 'tpope/vim-vinegar'
Plug 'editorconfig/editorconfig-vim'
Plug 'vim-utils/vim-man' Plug 'vim-utils/vim-man'
Plug 'unblevable/quick-scope' Plug 'unblevable/quick-scope'
Plug 'igankevich/mesonic' Plug 'igankevich/mesonic'
Plug 'rhysd/vim-clang-format', { 'for': [ 'c', 'cpp'] } Plug 'rhysd/vim-clang-format', { 'for': [ 'c', 'cpp'] }
Plug 'adelarsq/vim-matchit'
Plug 'stefandtw/quickfix-reflector.vim' Plug 'stefandtw/quickfix-reflector.vim'
Plug 'yuttie/comfortable-motion.vim' Plug 'yuttie/comfortable-motion.vim'
Plug 'lifecrisis/vim-difforig'
Plug 'dag/vim-fish'
Plug 'pbrisbin/vim-syntax-shakespeare'
Plug 'zenzike/vim-haskell-unicode'
Plug 'lifepillar/pgsql.vim'
Plug 'purescript-contrib/purescript-vim'
Plug 'mbbill/undotree'
Plug 'airblade/vim-rooter'
" Initialize plugin system " Initialize plugin system
call plug#end() call plug#end()
@ -102,7 +109,6 @@ set exrc " Allow loading local .nvimrc files
set secure " Disallow use of autocmd, shell and write in local rc set secure " Disallow use of autocmd, shell and write in local rc
set showcmd " Show (partial) command in status line. set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets. set showmatch " Show matching brackets.
set showmode " Show current mode.
set ruler " Show the line and column numbers of the cursor. set ruler " Show the line and column numbers of the cursor.
set number " Show the line numbers on the left side. set number " Show the line numbers on the left side.
set formatoptions+=o " Continue comment marker in new lines. set formatoptions+=o " Continue comment marker in new lines.
@ -118,11 +124,18 @@ set noerrorbells " No beeps.
set modeline " Enable modeline. set modeline " Enable modeline.
set linespace=0 " Set line-spacing to minimum. set linespace=0 " Set line-spacing to minimum.
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
set noshowmode " Because of neovim's cursor shape
set splitbelow " Horizontal split below current. set splitbelow " Horizontal split below current.
set splitright " Vertical split to right of current. set splitright " Vertical split to right of current.
set nobackup " no backup files set nobackup " no backup files
set nowritebackup " only in case you don't want a backup file while editing set nowritebackup " only in case you don't want a backup file while editing
set noswapfile " no swap files set noswapfile " no swap files
set foldmethod=syntax " Create folds based on files syntax
set nofoldenable " Open folds by default
" Wild menu
set wildmenu
set wildmode=list:longest,full
set wildoptions=pum set wildoptions=pum
set pumblend=30 set pumblend=30
@ -172,12 +185,6 @@ nnoremap Q <Nop>
nnoremap <Leader>pg :PlugUpgrade<CR> nnoremap <Leader>pg :PlugUpgrade<CR>
nnoremap <Leader>pd :PlugUpdate<CR> nnoremap <Leader>pd :PlugUpdate<CR>
nnoremap <Leader>pc :PlugClean<CR> nnoremap <Leader>pc :PlugClean<CR>
" NerdTree
nnoremap <Leader>ee :NERDTreeVCS<CR>
nnoremap <Leader>ef :NERDTreeFind<CR>
nnoremap <Leader>eo :NERDTreeFocus<CR>
nnoremap <Leader>ec :NERDTreeClose<CR>
nnoremap <Leader>et :NERDTreeToggle<CR>
" For skim " For skim
nnoremap <Leader>vf :Files<CR> nnoremap <Leader>vf :Files<CR>
nnoremap <Leader>vg :GFiles<CR> nnoremap <Leader>vg :GFiles<CR>
@ -193,6 +200,8 @@ nnoremap <Leader>vsh :History/<CR>
" Use ripgrep to search for content in files " Use ripgrep to search for content in files
nnoremap <Leader>/ :Rg<CR> nnoremap <Leader>/ :Rg<CR>
nnoremap <Leader>b :ls<CR>:b<Space> nnoremap <Leader>b :ls<CR>:b<Space>
" Undo tree
nnoremap <Leader>u :UndotreeToggle<CR>
" Save " Save
nnoremap <Leader>w <Esc>:w<CR> nnoremap <Leader>w <Esc>:w<CR>
" Search and Replace " Search and Replace
@ -303,6 +312,13 @@ autocmd FileType scheme nnoremap <buffer> <Leader>re :normal mscpaF<cr>`s
" Evaluates the entire file. " Evaluates the entire file.
autocmd FileType scheme nnoremap <buffer> <Leader>rf :normal msggcpG<cr>`s autocmd FileType scheme nnoremap <buffer> <Leader>rf :normal msggcpG<cr>`s
" Toggles search highlighting off/on according to current mode. Source: http://blog.sanctum.geek.nz/vim-search-highlighting/
augroup ToggleSearchHighlighting
autocmd!
autocmd InsertEnter * setlocal nohlsearch
autocmd InsertLeave * setlocal hlsearch
augroup END
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
@ -404,7 +420,7 @@ let g:SuperTabDefaultCompletionType = "<c-n>"
let g:workspace_session_directory = $HOME . '/.vim/session/' let g:workspace_session_directory = $HOME . '/.vim/session/'
let g:workspace_undodir = $HOME . '/.vim/undodir' let g:workspace_undodir = $HOME . '/.vim/undodir'
let g:workspace_autosave = 0 let g:workspace_autosave = 0
let g:workspace_autosave_ignore = ['gitcommit', 'qf', 'nerdtree', 'tagbar'] let g:workspace_autosave_ignore = ['gitcommit', 'qf', 'tagbar']
" For comfortable motion " For comfortable motion
let g:comfortable_motion_scroll_down_key = "j" let g:comfortable_motion_scroll_down_key = "j"
let g:comfortable_motion_scroll_up_key = "k" let g:comfortable_motion_scroll_up_key = "k"