-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.vim
101 lines (70 loc) · 1.79 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
" automated installation of junegunn/vim-plug if not installed
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source ~/.config/nvim/init.vim
endif
set mouse=a
call plug#begin('~/.config/nvim/plugged')
" smooth scroll
Plug 'psliwka/vim-smoothie'
Plug 'preservim/nerdtree'
Plug 'tpope/vim-surround'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" Plug 'vim-airline/vim-airline'
" Plug 'othree/html5.vim'
" Plug 'a-vrma/black-nvim', {'do': ':UpdateRemotePlugins'}
" Distraction free mode. Toggle with :Goyo
Plug 'junegunn/goyo.vim'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'majutsushi/tagbar'
call plug#end()
"
" General settings
"
" Highlight bad white spaces
autocmd BufEnter * highlight BadWhitespace ctermbg=red guibg=red
autocmd BufEnter * match BadWhitespace /^\t\+/
autocmd BufEnter * match BadWhitespace /\s\+$/
" Search settings
set hlsearch
set incsearch
set hidden
" read open files again when changed outside Vim
set autoread
" which directory to use for the file browser
set browsedir=current
" show the cursor position all the time
set ruler
" display incomplete commands
set showcmd
" configure persitent undo
set undodir=/var/vim_undo
" folding
set foldmethod=indent
" display line numbers
set nu
" Removes trailing spaces.
"
" Invoke it with `:call TrimWhiteSpaces`
function TrimWhiteSpaces()
%s/\s*$//
''
:endfunction
"
" Plugin setup
"
"
" Go setup
"
" let g:go_fmt_command = "goimports"
"
" nerdtree setup
"
let NERDTreeIgnore = ['\.pyc$']
"
" FZF setup
"
let mapleader = " "
nnoremap <silent> <Leader><Space> :Files<CR>