-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
133 lines (108 loc) · 4.13 KB
/
init.vim
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
" An example for a vimrc file.
"
" To use it, copy it to
" for Unix: $HOME/.config/nvim/init.vim
" for Windows: %LOCALAPPDATA%\nvim\init.vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" PLUGINS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use vim-plug plugin manger - https://github.com/junegunn/vim-plug
" VIM-PLUG INSTALLATION
" curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
call plug#begin('~/.local/share/nvim/plugged')
Plug 'bling/vim-airline'
Plug 'airblade/vim-gitgutter'
Plug 'vim-syntastic/syntastic'
" Initialize plugin system
call plug#end()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" END PLUGINS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set backup " keep a backup file (restore to previous version)
set undofile " keep an undo file (undo changes after closing)
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
" Don't use Ex mode, use Q for formatting
noremap Q gq
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
" Switch syntax highlighting on
syntax on
" Also switch on highlighting the last used search pattern. (Neovim default)
" set hlsearch
" I like highlighting strings inside C comments.
let c_comment_strings=1
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'textwidth' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
autocmd!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") |
\ execute "normal! g`\"" |
\ endif
augroup END
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set buftype=nofile | read ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" LANDON'S CHANGES
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set background=dark
colorscheme harlequin
set directory=~/tmp/vimbackup//
set backupdir=~/tmp/vimbackup//
" Default to case insensitive searching.
" Case sensitive search only when upper case is included in search term
set ignorecase
set smartcase
" Always show the status bar (Neovim default)
" set laststatus=2
" Spaces not tabs. Frak you Richard!
set tabstop=4
set shiftwidth=4
set softtabstop=4
set shiftround
set expandtab
" Always show the line number on the left
set number
"Highlight the current line
set cursorline
" Disable the freaking bell
set belloff=all
"
" Flag trailing whitespace
match SpellBad '\s\+$'
" Remap pane movement
nmap <c-j> <c-w>j
nmap <c-k> <c-w>k
nmap <c-h> <c-w>h
nmap <c-l> <c-w>l
" Enable mouse in all(a) vim modes (Neovim default)
" set mouse=a
" Open splits on the right/bottom by default
set splitright
set splitbelow
"vim-syntastic
" Always stick any detected errors into the location list
let g:syntastic_always_populate_loc_list = 1
" Automatically open and/or close the location list
"let g:syntastic_auto_loc_list = 1
" Check for error when buffers are loaded
let g:syntastic_check_on_open = 1
" Disable check for error when buffers are written to disk
let g:syntastic_check_on_wq = 0
map <F6> :Errors<CR>