summaryrefslogtreecommitdiff
path: root/neovim/init.vim
diff options
context:
space:
mode:
authorPrefetch2024-03-02 20:24:21 +0100
committerPrefetch2024-03-02 20:24:21 +0100
commitdad91296c96b37c8da7d7adcc3046396f3270a46 (patch)
tree9682bfaa8b743b4580acc73907bfe3ba5dedf0fd /neovim/init.vim
parent43dcddba333c09085d0890280c20ae3739d1ae08 (diff)
Add Neovim configHEADmaster
Diffstat (limited to 'neovim/init.vim')
-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