~tardypad/dotfiles

ref: 7dd5e02494e2821ff6b4fd5758a590ef03b5403b dotfiles/packages/vim/vimrc -rw-r--r-- 3.4 KiB
7dd5e024 โ€” Damien Tardy-Panis add mako package config 3 years ago
                                                                                
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
" VIM Configuration
set nocompatible          " Cancel the compatibility with Vi

" Define the plugins
source ~/.vim/plugins.vim

" Use space as leader
let mapleader = "\<Space>"

" binding to reload config
nnoremap r :source $MYVIMRC<CR>

" Disable space moves cursor in non editing mode
noremap <Space> <nop>
vnoremap <Space> <nop>

" disable usage of Ctrl-J as Enter in command mode
cnoremap <C-J> <nop>

" remove ex mode binding
nmap Q <nop>

" Activate syntax coloring
syntax enable

" color scheme
colorscheme tardypad

" Show keys typed in status line
set showcmd

" -- Display
set title                 " Update the title of your window or your terminal
set relativenumber        " Display relative line numbers
set ruler                 " Display cursor position
set nowrap                " Don't wrap lines when they are too long
set sidescroll=10         " horizontal scroll of columns
set cursorline            " highlight the current line
set scrolloff=3           " Display at least 3 lines around you cursor
                          " (for scrolling)

" -- Beep
set novisualbell          " Prevent Vim from beeping
set noerrorbells          " Prevent Vim from beeping

" Backspace behaves as expected
set backspace=indent,eol,start

" -- Tabs
set tabstop=4       " number of visual spaces per tab
set softtabstop=4   " number of spaces in tab when editing
set expandtab       " tabs are spaces when editing
set shiftwidth=4    " size of an indentation
set smarttab        " tab makes cursor goes to next indent when editing new line

" Visual autocomplete for command menu
set wildmenu

" Define files to ignore in globbing / expanding / ...
set wildignore+=*~,*.swp

" automatically reload file when modified outside of vim
" and not modified locally
set autoread

" Hide buffer (file) instead of abandoning when switching
" to another buffer
set hidden

" Activate specific behavior per file type such as syntax and indentation
filetype on
filetype plugin on
filetype indent on

" Decrease silent time before swap file gets written
set updatetime=500

" Go to insert mode after/before 2 newlines
nmap 2o A<CR><CR>
nmap 2O I<CR><CR><Esc>kki

" correct joining of lines if comments
set formatoptions+=j

" define characters considered part of a word
" all alpha characters, all digits, all alpha characters with accent
set iskeyword=@,48-57,192-255

" faster access to grep help files
cnoreabbrev H helpgrep

" Enable swap / backup / undo files for buffers
" and store them preferably separately from the edited file location
" ^= means prepend to the default directories list
" // means use the full file path as name (prevent name collisions)
set swapfile
set backup
set undofile
set directory^=~/.vim/swap//
set backupdir^=~/.vim/backup//
set undodir^=~/.vim/undo//
set viminfo+=n~/.vim/viminfo

" Define special characters highlight display
set listchars=extends:>,tab:>\ ,trail:ยท
set list

" lighter vertical split display
set fillchars+=vert:โ”‚

" Load all conf files with their possible
let s:find_conf_cmd = "find ~/.vim/config.d/ -maxdepth 1 -name '*.vim'"
let s:conf_files = glob("`" . s:find_conf_cmd . "`")
for conf in split(s:conf_files, '\n')
  exe 'source' conf
endfor

" Load all plugins conf files with their possible
let s:find_plugins_conf_cmd = "find ~/.vim/config.d/plugins -name '*.vim'"
let s:plugins_conf_files = glob("`" . s:find_plugins_conf_cmd . "`")
for conf in split(s:plugins_conf_files, '\n')
  exe 'source' conf
endfor