mirror of
https://github.com/prurigro/darkcloud-nvimconfig.git
synced 2024-11-13 16:32:30 -05:00
Enabled spellcheck when editing email and git commit messages, configured some formatting options, and added some key combinations to navigate with <ctrl> and select with <shift>
This commit is contained in:
parent
9f5905f38f
commit
17111bdbf8
2 changed files with 57 additions and 39 deletions
|
@ -11,6 +11,7 @@
|
||||||
" ds" | (N) -> delete surrounding ""
|
" ds" | (N) -> delete surrounding ""
|
||||||
"
|
"
|
||||||
" Mappings:
|
" Mappings:
|
||||||
|
" <Shift-MiddleClick> | (A) -> unbind this from vim so xorg can paste
|
||||||
" <Leader><n> | (A) -> go to the next open tab
|
" <Leader><n> | (A) -> go to the next open tab
|
||||||
" <Leader><p> | (A) -> go to the previous open tab
|
" <Leader><p> | (A) -> go to the previous open tab
|
||||||
" <Tab> | (V) -> indent a block in visual mode
|
" <Tab> | (V) -> indent a block in visual mode
|
||||||
|
@ -22,14 +23,21 @@
|
||||||
" <F5> | (N) -> toggle line wrapping
|
" <F5> | (N) -> toggle line wrapping
|
||||||
" <F6> | (A) -> toggle visible trailing whitespace
|
" <F6> | (A) -> toggle visible trailing whitespace
|
||||||
" <F12> | (A) -> toggle collapsed/folded rows
|
" <F12> | (A) -> toggle collapsed/folded rows
|
||||||
|
" <Shift-p> | (V) -> paste and replace the selection
|
||||||
|
" <Shift-p> | (N) -> paste and replace the current word
|
||||||
" <Leader><C-f> | (N) -> format document and return to current line
|
" <Leader><C-f> | (N) -> format document and return to current line
|
||||||
" <Leader><C-w> | (N) -> remove whitespace
|
" <Leader><C-w> | (N) -> remove whitespace
|
||||||
" <Shift-p> | (N) -> paste and replace the current word
|
" <Ctrl-Up> | (N) -> move to the beginning of the document
|
||||||
" <Shift-p> | (V) -> paste and replace the selection
|
" <Ctrl-Down> | (N) -> move to the end of the document
|
||||||
" <Ctrl-Up> | (A) -> move up a chunk of text
|
" <Ctrl-Right> | (N) -> move to the end of the line
|
||||||
" <Ctrl-Down> | (A) -> move down a chunk of text
|
" <Ctrl-Left> | (N) -> move to the beginning of the non-whitespace
|
||||||
" <Shift-Left> | (N) -> move to the start of the text
|
" <Ctrl-\> | (N) -> move to the beginning of the line
|
||||||
" <Shift-Right> | (N) -> move to the end of the line
|
" <Ctrl-a> | (N) -> select all
|
||||||
|
" <Shift-Up> | (N) -> select all text above the cursor
|
||||||
|
" <Shift-Down> | (N) -> select all text below the cursor
|
||||||
|
" <Shift-Right> | (N) -> select all text to the right of the cursor
|
||||||
|
" <Shift-Left> | (N) -> select to the beginning of the non-whitespace
|
||||||
|
" <Shift-\> | (N) -> select to the beginning of the line
|
||||||
"
|
"
|
||||||
" (neocomplcache)
|
" (neocomplcache)
|
||||||
" <Tab> | (I) -> write the part common to all suggestions
|
" <Tab> | (I) -> write the part common to all suggestions
|
||||||
|
@ -50,29 +58,33 @@
|
||||||
"
|
"
|
||||||
|
|
||||||
"MAPPINGS: GENERAL KEYBINDINGS AND REBINDINGS {{{
|
"MAPPINGS: GENERAL KEYBINDINGS AND REBINDINGS {{{
|
||||||
|
"map shift to enable middle-click paste while being held
|
||||||
|
noremap <S-Insert> <MiddleMouse>
|
||||||
|
noremap! <S-Insert> <MiddleMouse>
|
||||||
|
|
||||||
"tab and untabbing selected blocks
|
"tab and untabbing selected blocks
|
||||||
vmap <Tab> >gv
|
vnoremap <Tab> >gv
|
||||||
vmap <S-Tab> <gv
|
vnoremap <S-Tab> <gv
|
||||||
|
|
||||||
"move to the next and previous tabs
|
"move to the next and previous tabs
|
||||||
nnoremap <silent><expr> <Leader>n ':tabn<CR>'
|
nnoremap <Silent><Expr> <Leader>n ':tabn<CR>'
|
||||||
nnoremap <silent><expr> <Leader>p ':tabp<CR>'
|
nnoremap <Silent><Expr> <Leader>p ':tabp<CR>'
|
||||||
|
|
||||||
"toggle the cursor line and column
|
"toggle the cursor line and column
|
||||||
nnoremap <silent><expr> <F3> ':set cursorline! cursorcolumn!<CR>'
|
nnoremap <Silent><Expr> <F3> ':set cursorline! cursorcolumn!<CR>'
|
||||||
|
|
||||||
"toggle the display of line numbers
|
"toggle the display of line numbers
|
||||||
nnoremap <silent><expr> <F4> ':set number!<CR>'
|
nnoremap <Silent><Expr> <F4> ':set number!<CR>'
|
||||||
|
|
||||||
"toggle line wrapping (and bottom bar if using the gui)
|
"toggle line wrapping (and bottom bar if using the gui)
|
||||||
if !has("gui_running")
|
if !has("gui_running")
|
||||||
nnoremap <silent><expr> <F5> ':set wrap!<CR>'
|
nnoremap <Silent><Expr> <F5> ':set wrap!<CR>'
|
||||||
else
|
else
|
||||||
nnoremap <silent><expr> <F5> ':set wrap! go'.'-+'[&wrap]."=b\r"
|
nnoremap <Silent><Expr> <F5> ':set wrap! go'.'-+'[&wrap]."=b\r"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"toggle the display of whitespace
|
"toggle the display of whitespace
|
||||||
nnoremap <silent><expr> <F6> ':set list!<CR>'
|
nnoremap <Silent><Expr> <F6> ':set list!<CR>'
|
||||||
|
|
||||||
"toggle folded code at foldpoints
|
"toggle folded code at foldpoints
|
||||||
inoremap <F12> <C-O>za
|
inoremap <F12> <C-O>za
|
||||||
|
@ -80,40 +92,43 @@
|
||||||
onoremap <F12> <C-C>za
|
onoremap <F12> <C-C>za
|
||||||
vnoremap <F12> zf
|
vnoremap <F12> zf
|
||||||
|
|
||||||
|
"map shift-p to paste and replace the current word or selection
|
||||||
|
vnoremap <S-p> "_d"0P
|
||||||
|
nnoremap <S-p> "_diwP
|
||||||
|
|
||||||
"format document then return to current line
|
"format document then return to current line
|
||||||
nnoremap <Leader><C-f> mzgg=G`z<CR>
|
nnoremap <Leader><C-f> mzgg=G`z<CR>
|
||||||
|
|
||||||
"remove trailing white space
|
"remove trailing white space
|
||||||
nnoremap <silent><expr> <Leader><C-w> ':FixWhitespace<CR>'
|
nnoremap <Silent><Expr> <Leader><C-w> ':FixWhitespace<CR>'
|
||||||
|
|
||||||
"map shift to enable middle-click paste while being held
|
"remap keys to scroll through text
|
||||||
map <S-Insert> <MiddleMouse>
|
nnoremap <C-Up> gg0
|
||||||
map! <S-Insert> <MiddleMouse>
|
nnoremap <C-Down> G$
|
||||||
|
nnoremap <C-Right> $
|
||||||
|
nnoremap <C-Left> ^
|
||||||
|
nnoremap <C-\> 0
|
||||||
|
|
||||||
"map shift-p to paste and replace the current word or selection
|
"map remap keys to select text
|
||||||
nnoremap <S-p> "_diwP
|
nnoremap <C-a> ggvG
|
||||||
vnoremap <S-p> "_d"0P
|
nnoremap <S-Up> vgg0
|
||||||
|
nnoremap <S-Down> vG$
|
||||||
"map ctrl-up/down to moving up/down by a block of text
|
nnoremap <S-Right> v$
|
||||||
map <C-Up> <C-U>
|
nnoremap <S-Left> v^
|
||||||
map <C-Down> <C-D>
|
nnoremap <S-\> v0
|
||||||
|
|
||||||
"map shift-left/right to move to the start/end of the line's text
|
|
||||||
nmap <S-Left> ^
|
|
||||||
nmap <S-Right> $
|
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"PLUGIN KEYBINDINGS {{{
|
"PLUGIN KEYBINDINGS {{{
|
||||||
"toggle the nerd tree sidebar
|
"toggle the nerd tree sidebar
|
||||||
nnoremap <silent><expr> <F1> ':NERDTree<CR>'
|
nnoremap <Silent><Expr> <F1> ':NERDTree<CR>'
|
||||||
|
|
||||||
"toggle the tagbar sidebar
|
"toggle the tagbar sidebar
|
||||||
nnoremap <silent><expr> <F2> ':TagbarToggle<CR>'
|
nnoremap <Silent><Expr> <F2> ':TagbarToggle<CR>'
|
||||||
|
|
||||||
"neocomplcache suggestions: cancel, autocomplete, scroll up and scroll down
|
"neocomplcache suggestions: cancel, autocomplete, scroll up and scroll down
|
||||||
inoremap <expr><Tab> pumvisible() ? neocomplcache#complete_common_string() : "\<Tab>"
|
inoremap <Expr><Tab> pumvisible() ? neocomplcache#complete_common_string() : "\<Tab>"
|
||||||
inoremap <expr><Backspace> pumvisible() ? neocomplcache#close_popup() : "\<Backspace>"
|
inoremap <Expr><Backspace> pumvisible() ? neocomplcache#close_popup() : "\<Backspace>"
|
||||||
inoremap <expr><Leader><Backspace> neocomplcache#undo_completion()
|
inoremap <Expr><Leader><Backspace> neocomplcache#undo_completion()
|
||||||
|
|
||||||
"emmet switch triggerkey from <Ctrl-Y> to <Ctrl-Z>
|
"emmet switch triggerkey from <Ctrl-Y> to <Ctrl-Z>
|
||||||
let g:user_emmet_leader_key='<C-Z>'
|
let g:user_emmet_leader_key='<C-Z>'
|
||||||
|
@ -130,9 +145,9 @@
|
||||||
|
|
||||||
"GVIM: MAPPINGS FOR GUI ELEMENTS {{{
|
"GVIM: MAPPINGS FOR GUI ELEMENTS {{{
|
||||||
"map toggles for the menu, toolbar and scrollbar
|
"map toggles for the menu, toolbar and scrollbar
|
||||||
noremap <silent><expr> <C-F1> ":if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>"
|
noremap <Silent><Expr> <C-F1> ":if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>"
|
||||||
noremap <silent><expr> <C-F2> ":if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>"
|
noremap <Silent><Expr> <C-F2> ":if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>"
|
||||||
noremap <silent><expr> <C-F3> ":if &go=~#'r'<Bar>set go-=r<Bar>else<Bar>set go+=r<Bar>endif<CR>"
|
noremap <Silent><Expr> <C-F3> ":if &go=~#'r'<Bar>set go-=r<Bar>else<Bar>set go+=r<Bar>endif<CR>"
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"ALIASES: COMMAND SHORTCUTS {{{
|
"ALIASES: COMMAND SHORTCUTS {{{
|
||||||
|
|
|
@ -19,10 +19,13 @@
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
syntax on "turn syntax highlighting on
|
syntax on "turn syntax highlighting on
|
||||||
set foldmethod=syntax foldcolumn=1 foldlevel=8 "configure how folding code works
|
set foldmethod=syntax foldcolumn=1 foldlevel=8 "configure how folding code works
|
||||||
|
set formatoptions=roqnl12 "configure format options
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"FILETYPES: SETTINGS SPECIFIC TO A FILETYPE {{{
|
"FILETYPES: SETTINGS SPECIFIC TO A FILETYPE {{{
|
||||||
au BufNewFile,BufRead *.txt set spell "enable spellcheck for text files (*.txt)
|
au FileType mail setl spell "enable spellcheck for e-mail (mutt)
|
||||||
|
au FileType gitcommit setl spell "enable spellcheck in git commits
|
||||||
|
au BufNewFile,BufRead *.txt setl spell "enable spellcheck for text files (*.txt)
|
||||||
au BufNewFile,BufRead *tmux.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
au BufNewFile,BufRead *tmux.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
||||||
au BufNewFile,BufRead pacman.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
au BufNewFile,BufRead pacman.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
||||||
au BufNewFile,BufRead yaourtrc setf sh "set syntax for *tmux.conf to sh (bash)
|
au BufNewFile,BufRead yaourtrc setf sh "set syntax for *tmux.conf to sh (bash)
|
||||||
|
|
Loading…
Reference in a new issue