-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
170 lines (128 loc) · 3.88 KB
/
Copy pathvimrc
File metadata and controls
170 lines (128 loc) · 3.88 KB
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
source $HOME/.vim/plugins.vim
let mapleader = "\<space>"
nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
nnoremap <silent> <loalleader> :<c-u>WhichKey ','<CR>
filetype plugin indent on
" vim-gitgutter configuration
set updatetime=250
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=500
" Set to auto read when a file is changed from the outside
set autoread
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM user interface
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set path+=**
" Turn on the Wild menu
set wildmenu
" Ignore compiled files
set wildignore+=*.o,*~
if has('win32unix')
set wildignore+=.git\*
elseif has("unix")
set wildignore+=*/.git/*
set wildignore+=*.out
set wildignore+=*/node_modules/*
set wildignore+=*/dist/*
set wildignore+=*/coverage/*
set wildignore+=*/.vscode/*
endif
" Always show current position
set ruler
" Height of the command bar
set cmdheight=1
" A buffer becomes hidden when it is abandoned
set hidden
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set nowrap
" Ignore case when searching
set ignorecase
" Highlight search results
set hlsearch
" Highlight text after 80 characters
augroup vimrc_autocmds
autocmd BufEnter * highlight OverLength ctermbg=darkgrey guibg=#111111
autocmd BufEnter * match OverLength /\%80v.*/
augroup END
" Makes search act like search in modern browsers
set incsearch
" Don't redraw while executing macros (good performance config)
set lazyredraw
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
"set timeoutlen=500
" Add a bit extra margin to the left
set foldcolumn=1
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting
syntax enable
" Enable 256 colors palette in Gnome Terminal
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
try
colorscheme PaperColor
catch
colorscheme desert
endtry
set background=dark
" Remove background color definition to have transparency
highlight Normal ctermbg=NONE
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" Use Unix as the standard file type
set fileformats=unix,dos,mac
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Turn backup off
set nobackup
set nowritebackup
set noswapfile
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent relate
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use spaces instead of tabs
set expandtab
" Be smart when using tabs ;)
set smarttab
" 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2
" Linebreak on 500 characters
set linebreak
set textwidth=500
set autoindent
set smartindent
" Use hybrid line numbers
set number relativenumber
set cursorline
"set list
set listchars=tab:▸\ ,eol:¬,space:·
"set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣
set diffopt+=vertical
function! EchoTest()
echo "this is a test"
endfunction
function! TestThis()
!export NODE_ENV=test && clear && npx mocha -r 'ts-node/register' % --exit
endfunction
function! BuildThis()
!clear && npm run build
endfunction
command! BufOnly silent! execute "%bd|e#|bd#"
autocmd BufRead /tmp/psql.edit.* set syntax=sql
source $HOME/.vim/keys/maps.vim