-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
117 lines (90 loc) · 2.88 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
set nocompatible " be iMproved, required
set nu
set relativenumber
set incsearch
set hlsearch
set foldmethod=indent
filetype off " required
set mouse=a
if has("mouse_sgr")
set ttymouse=sgr
else
set ttymouse=xterm2
end
source ~/.vimrc_plugins
" configure expanding of tabs for various file types
au BufRead,BufNewFile *.py set expandtab
au BufRead,BufNewFile *.c set noexpandtab
au BufRead,BufNewFile *.h set noexpandtab
au BufRead,BufNewFile Makefile* set noexpandtab
let s:personnal_folder = $HOME . "/.vim/local/"
let s:vim_files = split(globpath(s:personnal_folder, "*.vim"), "\n")
for s:conf_file in s:vim_files
execute "source " . s:conf_file
endfor
au BufNewFile *.sh call ShellShebang()
function! ShellShebang()
normal i#/bin/zsh
write
endfunction
let g:SuperTabMappingForward = '<s-tab>'
let g:SuperTabMappingBackward = '<tab>'
" --------------------------------------------------------------------------------
" configure editor with tabs and nice stuff...
"--------------------------------------------------------------------------------
set expandtab " enter spaces when tab is pressed
set textwidth=120 " break lines when line length increases
set tabstop=4 " use 4 spaces to represent tab
set softtabstop=4
set shiftwidth=4 " number of spaces to use for auto indent
set autoindent " copy indent from current line when starting a new line
" make backspaces more powerfull
set backspace=indent,eol,start
set ruler " show line and column number
syntax on " syntax highlighting
set showcmd " show (partial) command in status line
Plugin 'scrooloose/nerdtree'
let g:NERDTreeNodeDelimiter = "\u00a0"
" Open .vimrc
nnoremap <leader>rc :tabnew $MYVIMRC<cr>
map <F3> :source $MYVIMRC<cr>
" Naviguation
map <F2> :NERDTreeToggle<CR>
map <C-f> :NERDTreeFocus<CR>
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
imap <C-j> <C-o><C-W>j
imap <C-k> <C-o><C-W>k
imap <C-h> <C-o><C-W>h
nnoremap <tab> gt
nnoremap <s-tab> gT
map <C-l> <C-o><C-W>l
" remove auto comment
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" let NERDTreeMapOpenInTab='<space>'
set autochdir
map <C-t> :tabnew None <CR>
set path+=**
set wildmenu
" needed so that vim still understands escape sequences
map <C-n> :noh<CR>
" Fast write
imap <C-w> <C-o>:w<CR>
" Copy paste to sytem clipboard
vmap <C-c> "*y
map <C-v> "*p
colorscheme seattle
" Personnal status bar
set laststatus=2
set statusline=%r\ %F\ %m\ %=%l,%-c\ --\ %p%%\ \
function! DirectoryHeaders()
let l:directory = split(getline("."), " ")[1]
let l:directory = l:directory[2:]
let l:buffer_commad = LoadHeaders(l:directory)
echom l:buffer_commad
return l:buffer_commad
endfunction
nnoremap <leader>l :execute DirectoryHeaders()<cr>
nnoremap <leader>q :call SwitchQuote()<cr>