summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xneovim/init.vim86
1 files changed, 86 insertions, 0 deletions
diff --git a/neovim/init.vim b/neovim/init.vim
new file mode 100755
index 0000000..e49f9d6
--- /dev/null
+++ b/neovim/init.vim
@@ -0,0 +1,86 @@
+" ================ Settings ================
+
+" Show current line number absolute, others relative
+set number
+set relativenumber
+
+" Highlight current line and column
+set cursorline
+set cursorcolumn
+
+" Make tabs and trailing spaces visible
+set list
+set listchars=tab:>-,trail:-
+set tabstop=4 " Width of tab char
+set shiftwidth=4 " Width of indentation
+
+" Highlight matching [], {}, and ()
+set showmatch
+
+" Case-insensitive search unless capitals are used
+set ignorecase
+set smartcase
+
+" Spare SSDs from unnecessary writes
+set noswapfile
+set shada="NONE"
+set viminfo="NONE"
+
+" Make some commands more intuitive for wrapped lines
+nnoremap j gj
+nnoremap k gk
+"nnoremap 0 g0
+"nnoremap ^ g^
+"nnoremap $ g$
+
+" Tolerate commonly mistyped commands
+command WQ wq
+command Wq wq
+command Q q
+command W w
+
+" Ensure proper syntax highlighting
+autocmd BufRead,BufFilePre,BufNewFile *.asm set filetype=nasm
+autocmd BufRead,BufFilePre,BufNewFile *.md,*.pdc set filetype=markdown.pandoc
+
+
+
+" ================ Plugins =================
+
+" Start plugin manager (https://github.com/junegunn/vim-plug)
+call plug#begin('~/.config/nvim/plug')
+
+" Better terminal integration (https://github.com/wincent/terminus)
+Plug 'wincent/terminus'
+
+" My favourite colour scheme (https://github.com/joshdick/onedark.vim)
+Plug 'joshdick/onedark.vim'
+
+" Lightweight statusline (https://github.com/itchyny/lightline.vim)
+Plug 'itchyny/lightline.vim'
+" Also apply onedark theme to statusline
+let g:lightline = { 'colorscheme' : 'onedark' }
+" Only let lightline show current mode
+set noshowmode
+
+" Better syntax packs (https://github.com/sheerun/vim-polyglot)
+Plug 'sheerun/vim-polyglot'
+let g:polyglot_disabled = [] " blacklist
+
+" Markdown syntax (https://github.com/vim-pandoc/vim-pandoc-syntax)
+" which properly highlights LaTeX maths code inside documents
+Plug 'vim-pandoc/vim-pandoc-syntax'
+
+" Convenient movement (https://github.com/justinmk/vim-sneak)
+Plug 'justinmk/vim-sneak'
+let g:sneak#use_ic_scs = 1 " smartcase
+
+call plug#end()
+
+" Apply onedark colour scheme (must come after plug#end)
+if (has('termguicolors'))
+ set termguicolors
+endif
+colorscheme onedark
+" Clear background colour to improve contrast
+hi Normal guibg=none