-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold.vimrc
executable file
·160 lines (125 loc) · 3.13 KB
/
old.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
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
"
" Setup
"
set history=500 "Set buffer history
set mouse=a "Sometimes it's good to use mouse
set number "Show line number
set ruler "Show ruler
set magic "Helps with regex
set expandtab "Tabs as spaces (easier to indent code)
set smarttab "Helps with tabs
set shiftwidth=2 "Set width -> 1 tab == 2 spaces
set tabstop=2 "Number of spaces for tab
set linebreak "Wrap on linebreak
set textwidth=500 "Maximum width of text - linebreak on 500 characters
set wrap "Wraps text
set autoindent "Automatically indent from previous line
set smartindent "Extend autoindent
set noerrorbells "Fuck errors
set novisualbell "Fuck errors
set hlsearch "Highlight all search results
set ignorecase "Case-insensitive search
set incsearch "Show incremental search results as typedo
set nobackup "Don't make a backup before overwriting file
set nowritebackup "Same as above
set noswapfile "Ditch swapfile
syntax enable "Enable syntax highlight
command! SGB set spell spelllang=en_gb "We're in England, ey?
" https://stackoverflow.com/questions/62148994/strange-character-since-last-update-42m-in-vim
let &t_TI = "" "Fix weird characters
let &t_TE = ""
"
" More magic
"
" Search on <Space> (/)
map <space> /
" Backwards search on Ctrl-<space> (?)
map <c-space> ?
" Move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Fast saving
nmap <leader>w :w!<cr>
" ,ss toggles spell checking
map <leader>ss :setlocal spell!<cr>
"
" NERDTree
"
map <C-n> :NERDTreeToggle<CR>
let g:NERDTreeDirArrowExpandable = '►'
let g:NERDTreeDirArrowCollapsible = '▼'
let NERDTreeShowLineNumbers=1
let NERDTreeShowHidden=1
let NERDTreeMinimalUI = 1
let g:NERDTreeWinSize=38
"
" Status line
"
set laststatus=2 "Always show the status line
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
function! StatuslineGit()
let l:branchname = GitBranch()
return strlen(l:branchname) > 0?' '.l:branchname.' ':''
endfunction
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_SR = "\<Esc>]50;CursorShape=2\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
"
" Visual
"
try
colorscheme iceberg
catch
endtry
set background=dark
"
" Plugins
"
call plug#begin('~/.vim/plugged')
Plug 'sheerun/vim-polyglot'
Plug 'morhetz/gruvbox'
Plug 'vim-airline/vim-airline'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'luochen1990/rainbow'
Plug 'cocopon/iceberg.vim'
Plug 'preservim/nerdtree'
Plug 'rust-lang/rust.vim'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-repeat'
call plug#end()
colo iceberg
filetype plugin indent on
set backspace=indent,eol,start
" Set the rainbow!
let g:rainbow_active = 1
"
" Vim-Unimpaired
"
nmap < [
nmap > ]
omap < [
omap > ]
xmap < [
xmap > ]
"
" Go setup
"
" Might be slow
" If imports are fucked - gofmt
let g:go_fmt_command = "goimports"
let g:go_gocode_propose_source = 0
let g:go_auto_type_info = 1
let g:go_version_warning = 0
"
" Coc.nvim setup
"
" let g:coc_disable_startup_warning = 1
"
" Rust setup
"
let g:rustfmt_autosave = 1 "Run rustfmt on save