summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2020-08-21 16:18:34 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2020-08-21 16:18:34 +0100
commit27d3d523f7285d335a50575546dbed7f462777ed (patch)
treec3ce70ad643bc39029c84993ccbe7940ac6ee26f /.config
parent3c39522059766f54fa40bed6b38a9ea4aa2adb2e (diff)
Add nvim configuration files
Diffstat (limited to '.config')
-rw-r--r--.config/nvim/init.vim44
1 files changed, 44 insertions, 0 deletions
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 <leader>l :set list!<CR>
+
+" 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! <SID>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 <silent> <F5> :call <SID>StripTrailingWhitespaces()<CR>