diff options
author | typebrook <typebrook@gmail.com> | 2019-06-16 10:10:45 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2019-06-16 10:19:55 +0800 |
commit | 3a2e2cf27cbad20874d7eff5eea5048bdafc31ed (patch) | |
tree | 18009321c756817011ea014fd234268cfcbc7041 /vimrc | |
parent | b0ca9276f37491a8ddb1fa7ccace911713d3a667 (diff) |
update
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 35 |
1 files changed, 26 insertions, 9 deletions
@@ -11,12 +11,12 @@ set ss=1 | |||
11 | set siso=999 | 11 | set siso=999 |
12 | 12 | ||
13 | " general | 13 | " general |
14 | nmap <c-c> :q<cr> | 14 | nmap <c-c> :q<CR> |
15 | nnoremap <leader>R :.w !bash<cr> | 15 | nnoremap <leader>R :.w !bash<CR> |
16 | nnoremap <leader>, :w !bash<cr> | 16 | nnoremap <leader>, :w !bash<CR> |
17 | nnoremap <leader>W :set wrap!<cr> | 17 | nnoremap <leader>W :set wrap!<CR> |
18 | nnoremap <leader>T :vertical terminal<cr> | 18 | nnoremap <leader>T :vertical terminal<CR> |
19 | nnoremap <leader>u :set clipboard=unnamedplus<cr> | 19 | nnoremap <leader>u :set clipboard=unnamedplus<CR> |
20 | nnoremap <CR> o<Esc> | 20 | nnoremap <CR> o<Esc> |
21 | nnoremap <C-L> 60l | 21 | nnoremap <C-L> 60l |
22 | nnoremap <C-H> 60h | 22 | nnoremap <C-H> 60h |
@@ -29,12 +29,27 @@ nnoremap <silent> <leader>s | |||
29 | \ else <BAR> | 29 | \ else <BAR> |
30 | \ syntax enable <BAR> | 30 | \ syntax enable <BAR> |
31 | \ endif<CR> | 31 | \ endif<CR> |
32 | nnoremap <leader>S :echo join(reverse(map(synstack(line('.'), col('.')), 'synIDattr(v:val,"name")')),' ')<cr> | 32 | nnoremap <leader>S :echo join(reverse(map(synstack(line('.'), col('.')), 'synIDattr(v:val,"name")')),' ')<CR> |
33 | 33 | ||
34 | onoremap p i( | 34 | onoremap p i( |
35 | 35 | ||
36 | " new | ||
37 | nnoremap H 0 | ||
38 | nnoremap L $ | ||
39 | inoremap jk <ESC> | ||
40 | inoremap <ESC> <nop> | ||
41 | |||
42 | " surround with '' or "" | ||
43 | nnoremap <leader>' ea'<esc>bi'<esc>e | ||
44 | nnoremap <leader>" ea"<esc>bi"<esc>e | ||
45 | vnoremap ' <ESC>`<i'<ESC>`>la'<ESC> | ||
46 | vnoremap " <ESC>`<i"<ESC>`>la"<ESC> | ||
47 | |||
48 | " abbrev | ||
49 | iabbrev @@ typebrook@gmail.com | ||
50 | |||
36 | " vimwiki | 51 | " vimwiki |
37 | nnoremap <leader>tt :VimwikiTable<cr> | 52 | nnoremap <leader>tt :VimwikiTable<CR> |
38 | nnoremap <leader>wg :VimwikiGoto | 53 | nnoremap <leader>wg :VimwikiGoto |
39 | nnoremap <leader>wa :VimwikiSearchTags | 54 | nnoremap <leader>wa :VimwikiSearchTags |
40 | nnoremap <leader>i I- <esc>l | 55 | nnoremap <leader>i I- <esc>l |
@@ -53,10 +68,11 @@ let g:vim_markdown_conceal = 0 | |||
53 | " => Redirect the output of a Vim or external command into a scratch buffer | 68 | " => Redirect the output of a Vim or external command into a scratch buffer |
54 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | 69 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
55 | " Copy from : https://gist.github.com/romainl/eae0a260ab9c135390c30cd370c20cd7 | 70 | " Copy from : https://gist.github.com/romainl/eae0a260ab9c135390c30cd370c20cd7 |
71 | " | ||
56 | " Usage: | 72 | " Usage: |
57 | " :Redir hi ............. show the full output of command ':hi' in a scratch window | 73 | " :Redir hi ............. show the full output of command ':hi' in a scratch window |
58 | " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window | 74 | " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window |
59 | " | 75 | |
60 | function! Redir(cmd) | 76 | function! Redir(cmd) |
61 | for win in range(1, winnr('$')) | 77 | for win in range(1, winnr('$')) |
62 | if getwinvar(win, 'scratch') | 78 | if getwinvar(win, 'scratch') |
@@ -84,6 +100,7 @@ nnoremap <leader>r :Redir | |||
84 | " => Make Alt key works on Gnome terminal | 100 | " => Make Alt key works on Gnome terminal |
85 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | 101 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
86 | " Solution is here: https://stackoverflow.com/questions/6778961 | 102 | " Solution is here: https://stackoverflow.com/questions/6778961 |
103 | |||
87 | let c='a' | 104 | let c='a' |
88 | while c <= 'z' | 105 | while c <= 'z' |
89 | exec "set <A-".c.">=\e".c | 106 | exec "set <A-".c.">=\e".c |