Vim: Group as much as possible
This commit is contained in:
52
.vim/vimrc
52
.vim/vimrc
@@ -98,6 +98,10 @@ Plugin 'mhinz/vim-startify'
|
|||||||
|
|
||||||
call vundle#end() " required
|
call vundle#end() " required
|
||||||
|
|
||||||
|
" Packages {{{
|
||||||
|
packadd termdebug
|
||||||
|
" }}}
|
||||||
|
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
@@ -124,10 +128,6 @@ set hidden
|
|||||||
"set visualbell
|
"set visualbell
|
||||||
set nowrapscan
|
set nowrapscan
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Vim draw options {{{
|
|
||||||
|
|
||||||
set cursorline
|
set cursorline
|
||||||
set ttyfast
|
set ttyfast
|
||||||
set lazyredraw
|
set lazyredraw
|
||||||
@@ -162,13 +162,18 @@ set smartcase
|
|||||||
set gdefault
|
set gdefault
|
||||||
set hlsearch
|
set hlsearch
|
||||||
set incsearch
|
set incsearch
|
||||||
nnoremap <leader><space> :nohlsearch<cr>
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
set shell=/bin/bash
|
set shell=/bin/bash
|
||||||
set path+=**
|
set path+=**
|
||||||
packadd termdebug
|
set updatetime=100
|
||||||
|
set nospell
|
||||||
|
set runtimepath+=/usr/share/vim/vimfiles
|
||||||
|
set spelllang=en
|
||||||
|
" Dictionary path, from which the words are being looked up.
|
||||||
|
set dictionary+=/usr/share/dict/words
|
||||||
|
set clipboard=unnamed
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Undofile {{{
|
" Undofile {{{
|
||||||
|
|
||||||
@@ -188,9 +193,8 @@ if isdirectory($HOME . '/.vim/tags') == 0
|
|||||||
endif
|
endif
|
||||||
let g:gutentags_cache_dir='~/.vim/tags'
|
let g:gutentags_cache_dir='~/.vim/tags'
|
||||||
"let g:gutentags_ctags_extra_args=['--fields=+l']
|
"let g:gutentags_ctags_extra_args=['--fields=+l']
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
"
|
|
||||||
" Mappings {{{
|
" Mappings {{{
|
||||||
" Editing {{{
|
" Editing {{{
|
||||||
"Changing Leader Key
|
"Changing Leader Key
|
||||||
@@ -237,6 +241,13 @@ set pastetoggle=<F3>
|
|||||||
""nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
|
""nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
|
||||||
|
|
||||||
tnoremap <Esc> <C-W><C-W>
|
tnoremap <Esc> <C-W><C-W>
|
||||||
|
|
||||||
|
nnoremap S :%s//g<LEFT><LEFT>
|
||||||
|
xnoremap S :s//g<LEFT><LEFT>
|
||||||
|
xmap <BS> x
|
||||||
|
|
||||||
|
nnoremap <leader><space> :nohlsearch<cr>
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
" Plugins {{{
|
" Plugins {{{
|
||||||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
@@ -291,11 +302,6 @@ let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$']
|
|||||||
" Tagbar key bindings."
|
" Tagbar key bindings."
|
||||||
"nmap <leader>t :TlistToggle<cr>
|
"nmap <leader>t :TlistToggle<cr>
|
||||||
|
|
||||||
" ctrlp configuration
|
|
||||||
"let g:ctrlp_map = '<c-p>'
|
|
||||||
"let g:ctrlp_cmd = 'CtrlPLastMode'
|
|
||||||
"let g:ctrlp_user_command = 'ack --cpp --cc --hh --hpp -f %s'
|
|
||||||
"let g:ctrlp_working_path_mode = 'rw'
|
|
||||||
nnoremap <leader>fl :Lines<CR>
|
nnoremap <leader>fl :Lines<CR>
|
||||||
nnoremap <leader>fb :Buffers<CR>
|
nnoremap <leader>fb :Buffers<CR>
|
||||||
inoremap <leader>fs <ESC>:Snippets<CR>
|
inoremap <leader>fs <ESC>:Snippets<CR>
|
||||||
@@ -306,8 +312,6 @@ nnoremap <leader>ff :FZF<CR>
|
|||||||
" }}}
|
" }}}
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
set clipboard=unnamed
|
|
||||||
|
|
||||||
" Wildmenu completion {{{
|
" Wildmenu completion {{{
|
||||||
set wildmenu
|
set wildmenu
|
||||||
set wildmode=list:longest
|
set wildmode=list:longest
|
||||||
@@ -355,6 +359,7 @@ let g:miniBufExplStatusLineText = ''
|
|||||||
"set colorcolumn=120
|
"set colorcolumn=120
|
||||||
"call matchadd('ColorColumn', '\%80v', 100)
|
"call matchadd('ColorColumn', '\%80v', 100)
|
||||||
|
|
||||||
|
" autocmd {{{
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
"restore cursor position
|
"restore cursor position
|
||||||
autocmd BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
|
autocmd BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
|
||||||
@@ -372,6 +377,7 @@ if has("autocmd")
|
|||||||
" If you want to show the nearest function in your statusline automatically
|
" If you want to show the nearest function in your statusline automatically
|
||||||
autocmd VimEnter * call vista#RunForNearestMethodOrFunction()
|
autocmd VimEnter * call vista#RunForNearestMethodOrFunction()
|
||||||
endif
|
endif
|
||||||
|
"}}}
|
||||||
|
|
||||||
" Folding {{{
|
" Folding {{{
|
||||||
function! FoldFormat()
|
function! FoldFormat()
|
||||||
@@ -390,14 +396,6 @@ endif
|
|||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
set updatetime=100
|
|
||||||
|
|
||||||
set nospell
|
|
||||||
set runtimepath+=/usr/share/vim/vimfiles
|
|
||||||
set spelllang=en
|
|
||||||
" Dictionary path, from which the words are being looked up.
|
|
||||||
set dictionary+=/usr/share/dict/words
|
|
||||||
|
|
||||||
function! FindAlternate()
|
function! FindAlternate()
|
||||||
let l:ext = 'h'
|
let l:ext = 'h'
|
||||||
let l:curr_ext = expand('%:e')
|
let l:curr_ext = expand('%:e')
|
||||||
@@ -425,7 +423,7 @@ setglobal virtualedit=block
|
|||||||
setglobal shiftround
|
setglobal shiftround
|
||||||
|
|
||||||
set shortmess+=c
|
set shortmess+=c
|
||||||
"inoremap <silent><expr> <leader><space> coc#refresh()
|
inoremap <silent><expr> <leader><space> coc#refresh()
|
||||||
set signcolumn=yes
|
set signcolumn=yes
|
||||||
set cmdheight=2
|
set cmdheight=2
|
||||||
"inoremap <silent><expr> <TAB>
|
"inoremap <silent><expr> <TAB>
|
||||||
@@ -449,7 +447,7 @@ endfunction
|
|||||||
|
|
||||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||||
|
|
||||||
hi None ctermbg=None ctermfg=None
|
"hi None ctermbg=None ctermfg=None
|
||||||
|
|
||||||
let g:vim_search_pulse_mode = 'pattern'
|
let g:vim_search_pulse_mode = 'pattern'
|
||||||
let g:vim_search_pulse_duration = 400
|
let g:vim_search_pulse_duration = 400
|
||||||
|
|||||||
Reference in New Issue
Block a user