How to repeat a command with substitution in Vim?
Specifically for subsitutions: use & to repeat your last substitution on the current line from normal mode. To repeat for all lines, type :%&
Specifically for subsitutions: use & to repeat your last substitution on the current line from normal mode. To repeat for all lines, type :%&
I think this is operating system independent: if !isdirectory(“/my/directory”) call mkdir(“/my/directory”, “p”) endif
Let me propose the following implementation of the described behavior. nnoremap <silent> <leader>zj :call NextClosedFold(‘j’)<cr> nnoremap <silent> <leader>zk :call NextClosedFold(‘k’)<cr> function! NextClosedFold(dir) let cmd = ‘norm!z’..a:dir let view = winsaveview() let [l0, l, open] = [0, view.lnum, 1] while l != l0 && open exe cmd let [l0, l] = [l, line(‘.’)] let open = … Read more
This problem can be solved with the help of the keymap option. It allows to define an alternate keyboard mapping to use in modes requiring text input. To switch between the default and alternate keymaps while in Insert, Replace, or Command-line mode (but not Normal mode), use Ctrl+^ (Ctrl+6). Changing the keymap affects text input … Read more
One way to do that would be: vim “+call cursor(<LINE>, <COLUMN>)” For completeness this is another way: vim “+normal <LINE>G<COLUMN>|”
Could :saveas do the job? :sav[eas][!] [++opt] {file} Save the current buffer under the name {file} and set the filename of the current buffer to {file}. The previous name is used for the alternate file name.
if has(“gui_running”) ” C-Space seems to work under gVim on both Linux and win32 inoremap <C-Space> <C-n> else ” no gui if has(“unix”) inoremap <Nul> <C-n> else ” I have no idea of the name of Ctrl-Space elsewhere endif endif
Assuming <C-S-F6> actually works (it probably won’t in CLI Vim), you must escape the bar or use <bar> instead: :nnoremap <C-S-F6> :up \| !pdflatex %:t<CR> :nnoremap <C-S-F6> :up <bar> !pdflatex %:t<CR> See :help map_bar.
So if you have to use MS Word and want vim key bindings, there is an add on, but if you are not bound to that I would def. go for LaTeX + the vim latex suite.
If you are using the bash shell (on Linux/OS X/using Cygwin) is to add you ~/.bashrc file: gvim () { command gvim –remote-silent “$@” || command gvim “$@”; } On Windows I think you could have a gvim.bat batch-script to achieve the same.. gvim.exe -p –remote-tab-silent %1 %* If gvim.exe isn’t in your path Run … Read more