Skip to main content

Questions tagged [vimscript]

Vim script is the scripting language incorporated into the `vim` editor. It is based on the `ex` line editor of `vi`.

0 votes
1 answer
291 views

Why does my colorscheme sometimes get all messed in GVIM on Windows 10?

I have recently added the following code to $MYGVIMRC (which otherwise has been unchanged for years and has been working fine) to have my GVIM (8.2) on Windows 10 switch background automatically ...
Armen Michaeli's user avatar
9 votes
1 answer
7k views

Vim - can I pass multiple args to a custom command without writing a function

I have written following custom command in my .vimrc file: command! -nargs=+ Sub :%s/<args>/g It allows me to substitute one word for another and is executed like this: :Sub <word>/<...
Alex Mckay's user avatar
1 vote
2 answers
1k views

how can I open a terminal split in vim 8.1 without switching to it or going back to the previous split inside a vimscript

Basicly I want the following functionality: Using vims new terminal functionality, I want to be able to press a button, that opens a new terminal window, without stealing focus from the file I'm ...
user2741831's user avatar
0 votes
1 answer
135 views

Vim: Operator pending mode remaps not working

I'm trying to build a vimscript can be used with the Dvorak Simplified Layout. I.e., given that the keys on the keyboard plugged into the computer are laid out in the Dovark Simplified Layout (and the ...
Sergey Nikolayvich's user avatar
1 vote
1 answer
1k views

Vim highlight all text after multiple "#"

I am trying to make text bold if it appears after a series of # hashes. This is the line in my .vimrc: au BufRead,BufNewFile *.txt hi header cterm=cyan ctermbg=red and my attempted regular ...
haz's user avatar
  • 113
1 vote
1 answer
1k views

ability to switch between panes has broken in tmux with vim

Ok, so I run vim inside of tmux and recently (today in fact) I suddenly can't use ctrl+hjkl to switch between panes in tmux and vim, instead it just makes the bell sound and refuses to switch. If I ...
Thermatix's user avatar
  • 253
1 vote
2 answers
90 views

Import previous commands to edited command

I'm playing with zsh to change image modification time according to the 'Date/Time Original' exif attribute. For this I one command I do: PDATE=$(exiftool -p '$DateTimeOriginal' $PIC | sed 's/[: ]//...
Jakub's user avatar
  • 171
1 vote
1 answer
171 views

How can I unconditionally open any fold present, without errors, when invoking from the command-line?

So, this is similar to ‘execute command with range silently’; but that's in a mapping, and so the solution isn't applicable to what I'm trying to do. I'm using the Skim PDF-viewer with LaTeX Sync, ...
ELLIOTTCABLE's user avatar
  • 2,535
1 vote
0 answers
1k views

How to setup in `~/.vimrc` a mapping for `colorscheme` to toggle `solarized` between `dark` and `light`?

How to setup in ~/.vimrc a mapping for colorscheme to toggle solarized between dark and light? Both background and colorscheme in ~/.vimrc are badly misbehaving! I have setup solarized to work on vim ...
Annis Monadjem's user avatar
-1 votes
1 answer
223 views

Print tag folder in vim

I got this line in my .vimrc so that it look i parent directories untill it find a tag file. set tags=./tags; Is there a way to print the directory where vim found the tag file inside vim?
bemug's user avatar
  • 238
3 votes
1 answer
2k views

How can I take control over jumps `Ctrl-O` and `Ctrl-I` in Vimscript?

Is there any way I could use Vimscript to go through the list of jumps Ctrl-O, Ctrl-I and to pick the previous jump buffers/positions? Any suggestion is greatly appreciated.
Annis Monadjem's user avatar
2 votes
3 answers
584 views

Command to "go to end of last line that has content, in insert mode"

With plaintext files, when I reopen them in Vim to add content, I want to go to the end of the last line of content and get to insert mode. In ideal circumstances, a simple GA after opening the file ...
Sundar R's user avatar
  • 1,489
4 votes
1 answer
481 views

Check if vim is compiled with +X11 in .vimrc

I have two copies of vim installed. One is installed with macvim and necessarily configured with -X11 (to work with Cocoa), while the other is configured to +X11 (used in terminal, to work with a ...
Jeff's user avatar
  • 642
2 votes
1 answer
801 views

vim find buffer by absolute path

How can I find a buffer in vimscript when I have an absolute path, and as you know vim buffer names can be relative path? Is there a function for that?
user14416's user avatar
  • 378
0 votes
1 answer
68 views

Vim: Managing multiple wording alternatives

(After reading this, please suggest another wording for the question, because I couldn't come up with a better one) When writing and editing in Vim, whether texts for humans or texts for humans and ...
user345286's user avatar

15 30 50 per page