-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.vimrc
186 lines (162 loc) · 4.96 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
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
179
180
181
182
183
184
185
186
" ################################ My VIMRC ############################# {{{
" vim: et:tw=79:sw=4:ts=4:sts=4
"
" File: ~/.vimrc
" Author: Magnun Leno <magnun dot leno at gmail dot com>
" Copyright: GPLv3
" Description: List of settings for VIM setup
" }}}
set conceallevel=2
" I don't like \ as a leader.
let mapleader=","
" Plugins
let $PLUGINS='~/.vim/plugins.vim'
call plug#begin('~/.vim-plugins')
source $PLUGINS
call plug#end()
" Functions
let $MAPPINGS='~/.vim/functions.vim'
source $MAPPINGS
" Mappings
let $MAPPINGS='~/.vim/mappings.vim'
source $MAPPINGS
set nocompatible
filetype plugin indent on
" Enable Syntax highlight
syntax on
" Make vim searching incredible
set hlsearch incsearch smartcase
" Set VIM to use 256 colors
set t_Co=256
" Set termquicolors (Truecolor) for terminal, if supported
if (has("termguicolors"))
set termguicolors
endif
" Colorscheme Material Monokai
let g:materialmonokai_italic = 1
let g:materialmonokai_gui_italic = 1
let g:materialmonokai_subtle_spell = 1
let g:materialmonokai_subtle_airline = 1
let g:materialmonokai_custom_lint_indicators=1
let g:airline_theme='materialmonokai'
colorscheme material-monokai+
set background=dark
" Highlight Trailing Whitespaces
match Error /\s\+$/
if has("gui_running")
" No toolbar or Menu (someone use it?)
set guioptions-=T
set guioptions-=m
" No left and right scrollbar
set guioptions-=r
set guioptions-=L
set guifont=Hurmit\ Nerd\ Font\ Mono\ Medium\ 10
endif
" Enables Mouse. On TMUX use 'set -g mouse on'
set mouse=a
" Shows line numbers
set number
" Always shows the ruler (cursor position and etc)
set ruler
" Shows (partial) command in status line
set showcmd
" Show matching brackets.
set showmatch
" Highlight cursor line
set cursorline
" Tells vim to let 4 lines beforescrolling
set scrolloff=4
" Tells vim to break lines that exceeds the 'textwidth'
set nowrap linebreak
" Always shows the status line
set laststatus=2
" Eable folding and set it to use the marker
set foldenable foldmethod=indent
" Set hidden buffers
set hidden
" More powerful backspacing
set backspace=indent,eol,start
" Tells VIM that we are using a fast TTY
set ttyfast
" Keep 200 lines of command line history
set history=200
" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes+=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.pyc
set wildignore+=*.bak,~*,*.swp,*.o,*.info,*.aux,*.log,*.dvi,*.bbl,*.blg,*.brf,*.cb,*.ind,*.idx,*.ilg,*.inx,*.out,*.toc,*.pyc
" Set fillchars
set fillchars=vert:│
" Highlight the textwidth+1 column. In python files commonly is the 80th column
set colorcolumn=+1
" Don't try to highlight lines longer than 800 characters.
set synmaxcol=800
" Disable backup and swapfile
set nobackup noswapfile
" Fix split positioning
set splitbelow splitright
" Rounds indent to multiple of shiftwidth
set shiftround
" Complet matching text and show list
set wildmode=list:longest
" Disable preview window (faster navigation in completitions)
set completeopt=longest,menuone
" Automatically read a file that has changed on disk
set autoread
" set list listchars=tab:▸,trail:·,nbsp:·,
set list listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮,trail:⌴
" Remove appending of comment when press o or O
set formatoptions-=o
" Adds numbered lists formatting
set formatoptions+=n
" Don't break a line after a one-letter word
set formatoptions+=1
" Remove a comment leader when joining lines
set formatoptions+=j
" Time out on key codes but not mappings.
" Basically this makes terminal Vim work sanely.
set notimeout
set ttimeout
set ttimeoutlen=10
" Change folding text
function! MyFoldText() " {{{
let line = getline(v:foldstart)
let nucolwidth = &fdc + &number * &numberwidth
let windowwidth = winwidth(0) - nucolwidth - 3
let foldedlinecount = v:foldend - v:foldstart
" expand tabs into spaces
let onetab = strpart(' ', 0, &tabstop)
let line = substitute(line, '\t', onetab, 'g')
let line = substitute(line, '^\(\s*\)\s\(\w\)', '\1➤ \2', '')
let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
endfunction " }}}
set foldtext=MyFoldText()
" Resize splits when the window is resized
" au VimResized * :wincmd =
" Settigns for specific filetype
augroup filetypedetect
autocmd FileType vim setlocal foldmethod=marker
augroup END
" Make sure Vim returns to the same line when you reopen a file.
" Thanks, Steve Losh
augroup line_return
au!
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ execute 'normal! g`"zvzz' |
\ endif
augroup END
" fix typos
command WQ wq
command Wq wq
command W w
command Q q
command QW wq
" Highlight Trailing Whitespaces
match ErrorMsg /\s\+$/
try
source ~/.vim_localrc
catch
" No local config
endtry