getbufvar(winbufnr(window), '&buftype')
noremap <silent> K :execute "vert help ".expand("<cword>")<CR>
index(['qf', 'quickfix'], a:name) >= 0
Explanation:
The command :m .+1
(which can be abbreviated to :m+
) moves the current line to
after line number .+1
(current line number + 1).
After visually selecting some lines, entering :m '>+1
moves the selected lines
to after line number '>+1
(one line after the last selected line;
'>
is a mark assigned by Vim to identify the selection end). '<
,'>
will be
subsituted between ':' and 'm' automaticaly.
The ==
re-indents the line to suit its new position. For the visual-mode
mappings, gv
reselects the last visual block and =
re-indents that block.
nnoremap <silent> <A-j> :m .+1<CR>==
nnoremap <silent> <A-k> :m .-2<CR>==
inoremap <silent> <A-j> <Esc>:m .+1<CR>==gi
inoremap <silent> <A-k> <Esc>:m .-2<CR>==gi
vnoremap <silent> <A-j> :m '>+1<CR>gv=gv
vnoremap <silent> <A-k> :m '<-2<CR>gv=gv
I'v created a function in VIM named OpenCMD(), it used for open command line or terminal in VIM (And cd in the current file path)
func! OpenCMD()
if has('win32')
let com = '!cmd /c start cd '. expand('%:p:h')
else
let com = '!/usr/bin/gnome-terminal --working-directory=' . expand('%:p:h')
endif
silent execute com
endfunc
nmap cmd :call OpenCMD()