Five lines I put in a blank .vimrc
swordandsignals.com
Five lines I put in a blank .vimrc
1–10 of 133 posts
Re: Five lines I put in a blank .vimrc
#2Keeping the swapfile on is really helpful when I accidentally open the same file in two different vim editors. But I do recommend configuring vim to place swapfiles in a different location, so you’re not scattering them all over your disk.
Re: Five lines I put in a blank .vimrc
#3I'm not going to set noswf. However, I run into the problem the writer mentions all the time where I'm opening an already opened file. Is it possible to just switch to the already opened file?
Re: Five lines I put in a blank .vimrc
#4I'd prefer one line it and use the "long" names and add nocompatible
set nocompatible hlsearch incsearch ignorecase number
then sane tabs set et sts=4 sw=4Re: Five lines I put in a blank .vimrc
#5Why not one line?
set hls ic is nu noswf
On a serious note, personally disabling line numbers is the first thing I do in a new editor. Reduces visual noise—status line usually shows current line number anyway, jumping to a line might take a second and I found I don’t need to know my line numbers more frequently than once per month or so.What I do like to enable in an editor is visible whitespace characters (helps notice levels of indent, for example). In Vim that can be accomplished with:
set list listchars+=space:•
(Might take some tweaking to make whitespace appear subtly enough, depending on your color scheme.)Re: Five lines I put in a blank .vimrc
#6In Firefox on macOS, the font fallback to "Apple Color Emoji" is doing really weird things on my machine (like cutting off the top of the number "5").
With that said, thanks for the tips—`set noswapfile` definitely fits my workflow more than not.
Re: Five lines I put in a blank .vimrc
#7I have «relativenumber» but I’ve never touched swapfile. Otherwise I have the same 5. Funny - I often felt vim’s defaults are almost intentionally archaic.
Re: Five lines I put in a blank .vimrc
#8nmap ; :
Re: Five lines I put in a blank .vimrc
#9Keeping the swapfile on is really helpful when I accidentally open the same file in two different vim editors. But I do recommend configuring vim to place swapfiles in a different location, so you’re not scattering them all over your disk.
I actually went full on in the other direction and often have multiple vim instances working on the same file. It feels so much better than having to deal with swap file error messages. With the below it reloads the file when the window gets into focus. Super helpful when working in lots of terminal tabs. You just have to get into a habit of saving after every change as it conflicts otherwise.
" check for and load file changes when a window is focused. Together with
" `noswapfile` this allows to edit the same file in multiple nvim instances and
" have the changes reloaded whenever the focus is changed.
autocmd WinEnter,BufWinEnter,FocusGained * checktimeRe: Five lines I put in a blank .vimrc
#10I'd prefer one line it and use the "long" names and add nocompatible set nocompatible hlsearch incsearch ignorecase number then sane tabs set et sts=4 sw=4
Why nocompatible?