Steven Lu
  • Member for 6 years, 11 months
  • Last seen this week
Is it possible to properly repeat a visual replacement?
0 votes

As far as I can tell (Will need a few days of testing to confirm) This dragon has been slayed with the help of a suggestion from Reddit. The solution is: vmap p c<C-r>0<Esc>

View answer
How to track down the code during debugging?
Accepted answer
1 votes

I did find that the 21st line inside of a function named s:callback in the file referenced by <SNR>30 (in my case fzf.vim) is where the error is being thrown (the code is echoerr v:exception).

View answer
Python integration not working as usual
1 votes

This is really strange. Basically: in my compiled vims, as long as I run py import vim, vim becomes defined thereafter and everything works. So I can probably just add this statement in my vimrc ...

View answer
Is there a way to disable the command line window?
1 votes

I have not found a way to disable the command-line window, but, I have eliminated the need for the q: bind of mine, by removing it and changing the rest of my vim config to allow my command-line ...

View answer
How to see if Vim has a file opened or not, or has a buffer open
5 votes

nnoremap <Leader>f :call SmartNERDTree()<CR> function! SmartNERDTree() if @% == "" NERDTreeToggle else ...

View answer
Convert newline to something else in variable using substitute
2 votes

I've figured out that '\n' can be used in substitute() to refer to the null byte which is used internally to represent an end of line. This solved my problem.

View answer
How to write a value or variable into a file using only vimscript?
8 votes

writefile() is the ticket, but has some quirks you have to account for, such as splitting on newlines. An example: call writefile(split(varname, "\n", 1), glob('/path/to/file'), 'b')

View answer
How to run vim from command line and prevent press ENTER or type command to continue
1 votes

Providing the argument "+silent /${SEARCHTERM}" to vim was my solution. This should be equivalent to running the :/ search using :silent / which does the trick. No need to change how vim normally ...

View answer
How to get a variable with the contents of a file on the filesystem?
2 votes

This was easy. nnoremap <silent> <Leader>n :let @/ = join(readfile(glob("~/.vim/.search")), "\n")<CR>

View answer
Why is vim save so slow?
10 votes

The culprit in this particular situation was the Syntastic plugin. It's forking eslint. I load Syntastic on entering insert mode (using a vim-plug function loader). Vim is plenty snappy on its own....

View answer
Some "local to window" settings are being reset in Vim
4 votes

The offending plugin is jeffkreeftmeijer/vim-numbertoggle. I'll go drop a note on the Github now, and try to debug it. Update: It's plain to see that the autocommands are being set very ...

View answer
Is it possible to get the height of the buffer *including* word wrap?
1 votes

I find that the live buffer of the window is available in the python interface. This means I can use python to iterate the lines and compute for myself how many times each line wraps over, and then ...

View answer
Vim has spellcheck; does it have thesaurus?
1 votes

I thought about it and I think that this answer sufficiently addresses my concerns. It will use the web service and if it fails it will use a local mthesaur.txt fallback. It appears to provide a ...

View answer
How can I prevent (or at least prompt to confirm) absurdly large numbers from being used to prefix commands?
2 votes

I find that you are usually able to interrupt the repetition process by sending a SIGINT (Ctrl+C). As long as some vimscript is not running a really long inner loop, there is no DoS concern. See here ...

View answer
Spell-check blacklisting word sequences
9 votes

Alright, so I looked it up this way since I had Vim's source code lying around: $ cd ~/Documents/vim $ ack 'the the' ... runtime/doc/spell.txt 399:It can also be used to recognize "the the" and ...

View answer
Why does Vim force programming indentation when in "gitcommit" filetype?
6 votes

Here is how I solved the problem, by adding to my .vimrc: autocmd FileType gitcommit set nosmartindent | set formatoptions-=t This removes the option that causes the lines to auto-wrap (which is ...

View answer