-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc.symlink
178 lines (140 loc) · 3.69 KB
/
vimrc.symlink
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
"Forget compatibility with Vi. Who cares.
set nocompatible
" Set encoding
set encoding=utf-8
" searching
set hlsearch
set incsearch
set ignorecase
set smartcase
"Enable file types
filetype on
filetype plugin on
filetype indent on
syntax on
set t_Co=256
set ruler
set number
" if has('gui_running')
" color inkpot
" endif
set diffopt+=algorithm:patience
"Enable spell checking
set spell
set spelllang=en_us,de_20
set spellfile=~/.vim/spell/spellfile.add
noremap <silent> ,s :set spell!<CR>
highlight clear SpellBad
highlight clear SpellRare
highlight clear SpellLocal
highlight clear SpellCap
highlight SpellBad gui=undercurl cterm=underline ctermfg=red guisp=red
highlight SpellRare gui=undercurl cterm=underline ctermfg=red guisp=orange
highlight SpellLocal gui=undercurl cterm=underline ctermfg=blue guisp=blue
highlight SpellCap gui=undercurl cterm=underline ctermfg=yellow guisp=Yellow
set showcmd
set laststatus=2
" psst
set visualbell
set noerrorbells
" auto save on file change
set autowrite
" indent settings
set smartindent
set autoindent
" tabstop thingys
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
" macvim style
"set guioptions=aAce
"set guifont=Monaco:h12
call plug#begin('~/.vim/plugged')
let g:plug_shallow = 1
Plug 'itchyny/lightline.vim'
Plug 'bling/vim-bufferline'
Plug 'bronson/vim-trailing-whitespace'
Plug 'w0rp/ale'
Plug 'mattn/emmet-vim'
Plug 'tpope/vim-fugitive'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'pangloss/vim-javascript'
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
Plug 'gavocanov/vim-js-indent'
Plug 'michaeljsmith/vim-indent-object'
Plug 'arcticicestudio/nord-vim'
Plug 'wikitopian/hardmode'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-commentary'
Plug 'flazz/vim-colorschemes'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
call plug#end()
" set stylesheet
" color kellys
color nord
" set leader to something
let mapleader = "\<SPACE>"
" NERDTree
nmap <leader>n :NERDTreeToggle<CR>
" Windows navigation
noremap <silent> ,h :wincmd h<CR>
noremap <silent> ,j :wincmd j<CR>
noremap <silent> ,k :wincmd k<CR>
noremap <silent> ,l :wincmd l<CR>
" More useful command-line completion
set wildmenu
set wildmode=list:longest
set completeopt=menu,longest
" Bubble single lines
nmap <C-Up> ddkP
nmap <C-Down> ddp
" Bubble multiple lines
vmap <C-Up> xkP`[V`]
vmap <C-Down> xp`[V`]
" Backups
set backupdir=~/.dotfiles/vimtmp/
set directory=~/.dotfiles/vimtmp/
" enable backup
set backup
" show matching brackets
set showmatch
set matchtime=7
" easier hidden buffer usage
set hidden
" textmate like hidden symbols
set listchars=tab:▸\ ,eol:¬
nmap <leader>h :set list!<CR>
set list!
" ruby things
autocmd BufNewFile,BufRead *.erb set filetype=html.eruby
autocmd BufNewFile,BufRead *.scss set filetype=scss.css
" add json syntax highlighting
autocmd BufNewFile,BufRead *.json set ft=javascript
" backspace fix
set backspace=indent,eol,start
" Yank from the cursor to the end of the line, to be consistent with C and D.
nnoremap Y y$
" clearing highlighted search with leader q
nmap <leader>q :nohlsearch<CR>
" toggle linenumbers
nmap <leader>l :setlocal number!<CR>
" toggle paste
nmap <leader>p :set paste!<CR>
" toggle line wrapping
nmap <leader>w :setlocal wrap!<CR>:setlocal wrap?<CR>
" fzf
nmap <leader>b :Buffers<CR>
nmap <leader>o :Files<CR>
nmap <leader>H :History<CR>
" ALE
let g:ale_completion_enabled = 1
" hardmode
nnoremap <leader>k <Esc>:call ToggleHardMode()<CR>
" enable hardmode by default
"autocmd VimEnter,BufNewFile,BufReadPost * silent! call HardMode()
" highlight column 81
highlight ColorColumn ctermbg=DarkCyan
call matchadd('ColorColumn', '\%81v', 100)