-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
110 lines (83 loc) · 2.76 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
" # # # # # # # # # # # # # # # # # # # # # #
" _ __ ____ __ ___ ____ ______ #
" | | / / / _/ / |/ / / __ \ / ____/ #
" | | / / / / / /|_/ / / /_/ / / / #
" | |/ / _/ / / / / / / _, _/ / /___ #
" |___/ /___/ /_/ /_/ /_/ |_| \____/ #
" # # # # # # # # # # # # # # # # # # # # # #
" A place for all of my neovim settings
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
if has("win16") || has("win32")
set wildignore+=.git\*,.hg\*,.svn\*
else
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
endif
" Adds tab completion to words like neovim :)
set wildmenu
" Remaps leader (\) to ,
let mapleader=","
"Sets tabs to 4 instead of 8 spaces"
set ts=4 sw=4
"Syntax highlighting"
syntax on
"Shows matching brackets"
set showmatch
"Always shows location in file (line#)"
set ruler
"Autotabs for certain code"
set smarttab
"Show line numbers"
set number
"Highlights search matching
set hlsearch
" Dont highlight parenthesis
let g:loaded_matchparen=1
" Make double-<Esc> clear search highlights
nnoremap <silent> <Esc><Esc> <Esc>:nohlsearch<CR><Esc>
" Function to trim whitespace, can be called with :TrimWhitespace
fun! TrimWhitespace()
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
command! TrimWhitespace call TrimWhitespace()
" Disable arrow keys in non-insert mode
" And force myself to use the home row
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Put list of plugins in between these two
call plug#begin('~/.vim/plugged')
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
Plug 'junegunn/goyo.vim'
Plug 'preservim/nerdcommenter'
Plug 'preservim/nerdtree'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
call plug#end()
" Automatically install missing plugins
autocmd VimEnter *
\ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | q
\| endif
" Fixes vim in tmux not rendering 256bit colors correctly
set background=dark
set t_Co=256
" Disables automatic comment continuation on newline
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Fixes color changing to 16bit after leaving Goyo
autocmd! User GoyoLeave silent! source $HOME/.vimrc
" Vim powerline (airline) theme
let g:airline_theme='onedark'
" Remap ; --> :, makes entering command mode faster
nnoremap ; :
vnoremap ; :
command Fb NERDTree