From 27d3d523f7285d335a50575546dbed7f462777ed Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Fri, 21 Aug 2020 16:18:34 +0100 Subject: Add nvim configuration files --- .config/nvim/init.vim | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .config/nvim/init.vim (limited to '.config') diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..6705496 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,44 @@ +filetype on +filetype plugin on +filetype indent on " file type based indentation + +set nobackup +set nowb +set noswapfile + +colorscheme railscasts +syntax on " syntax highlighting on + +set tabstop=2 +set softtabstop=2 +set shiftwidth=2 +set expandtab + +set number " turn on line numbers + +:set wrap linebreak nolist + +" Shortcuts provided by http://vimcasts.org + +" Shortcut to rapidly toggle `set list` +nmap l :set list! + +" Use the same symbols as TextMate for tabstops and EOLs +set listchars=tab:▸\ ,eol:¬ + +"Invisible character colors +highlight NonText guifg=#4a4a59 +highlight SpecialKey guifg=#4a4a59 + +function! StripTrailingWhitespaces() + " Preparation: save last search, and cursor position. + let _s=@/ + let l = line(".") + let c = col(".") + " Do the business: + %s/\s\+$//e + " Clean up: restore previous search history, and cursor position + let @/=_s + call cursor(l, c) +endfunction +nnoremap :call StripTrailingWhitespaces() -- cgit v1.2.3-13-gbd6f