|
|
@ -309,10 +309,25 @@ function! DmenuOpen(cmd) |
|
|
|
execute a:cmd . " " . fname |
|
|
|
execute a:cmd . " " . fname |
|
|
|
endfunction |
|
|
|
endfunction |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Moves to open window, or focuses it |
|
|
|
|
|
|
|
" https://www.reddit.com/r/vim/comments/8f80o3/awesome_way_to_navigate_windows_and_autocreate/ |
|
|
|
|
|
|
|
function! WinMove(key) |
|
|
|
|
|
|
|
let t:curwin = winnr() |
|
|
|
|
|
|
|
exec "wincmd ".a:key |
|
|
|
|
|
|
|
if (t:curwin == winnr()) |
|
|
|
|
|
|
|
if (match(a:key,'[jk]')) |
|
|
|
|
|
|
|
wincmd v |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
wincmd s |
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
exec "wincmd ".a:key |
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
endfunction |
|
|
|
|
|
|
|
|
|
|
|
" Commands {{{1 |
|
|
|
" Commands {{{1 |
|
|
|
|
|
|
|
|
|
|
|
"gets the wp salts |
|
|
|
"gets the wp salts |
|
|
|
command WpSalts :r! curl https://api.wordpress.org/secret-key/1.1/salt 2> /dev/null |
|
|
|
command! WpSalts :r! curl https://api.wordpress.org/secret-key/1.1/salt 2> /dev/null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Mappings {{{1 |
|
|
|
" Mappings {{{1 |
|
|
@ -331,6 +346,12 @@ noremap <ScrollWheelDown> <nop> |
|
|
|
|
|
|
|
|
|
|
|
nnoremap <c-o> :call DmenuOpen("e")<cr> |
|
|
|
nnoremap <c-o> :call DmenuOpen("e")<cr> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" make ctrl + hjkl move + create windows |
|
|
|
|
|
|
|
nnoremap <C-h> :call WinMove('h')<cr> |
|
|
|
|
|
|
|
nnoremap <C-j> :call WinMove('j')<cr> |
|
|
|
|
|
|
|
nnoremap <C-k> :call WinMove('k')<cr> |
|
|
|
|
|
|
|
nnoremap <C-l> :call WinMove('l')<cr> |
|
|
|
|
|
|
|
|
|
|
|
" Make Ctrl C and Ctrl V work on system buffer |
|
|
|
" Make Ctrl C and Ctrl V work on system buffer |
|
|
|
" if in visual or insert mode respectively |
|
|
|
" if in visual or insert mode respectively |
|
|
|
vnoremap <C-c> "+y |
|
|
|
vnoremap <C-c> "+y |
|
|
|