-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
99 lines (77 loc) · 2.59 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
set nocompatible
source ~/.vim/plugins.vim
let mapleader = ","
syntax enable
colorscheme tomorrow "Themes are stored in ~/.vim/colors directory
set backspace=indent,eol,start "Make backspace behave like every other editor
set number "Precede each line with its line number
set expandtab "Tabs are converted to spaces
set cursorline "Highlight the line of the cursor
set nowrap "Do not wrap long lines
set incsearch "Highlight while typing a search command
set hlsearch "Highlight all search matches
set showmatch "Highlight matching [{()}]
set splitright "Default to split to the right
set splitbelow "Default to split below
set list
set listchars=tab:▷⋅,trail:⋅,nbsp:⋅
set tabstop=4
set softtabstop=4
set shiftwidth=4
set fileencoding=utf-8
set encoding=utf-8
"---------- Ctrl-P ----------"
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
let g:ctrlp_match_window = 'top,order:ttb,min:1,max:30,results:30'
"Open files in a new tab
let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': ['<2-LeftMouse>'],
\ 'AcceptSelection("t")': ['<cr>'],
\ }
"---------- NERDTree ----------"
nmap <D-1> :NERDTreeToggle<cr>
nmap <leader>1 :NERDTreeToggle<cr>
"---------- Elixir ----------"
let g:alchemist#elixir_erlang_src = "/usr/local/bin/elixir"
"---------- MacVim ----------"
set t_Co=256
set laststatus=2
set background=dark
set guifont=Hack:h15
set linespace=2
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
"---------- Syntax ----------"
"highlight CursorLine cterm=NONE ctermbg=232
"highlight CursorLineNr ctermfg=172
"highlight LineNr ctermfg=240
"---------- Mappings ----------"
nmap <leader>ev :tabedit ~/.vimrc<cr>
nmap <leader><space> :nohlsearch<cr>
nmap <c-R> :CtrlPBufTag<cr>
nmap <D-e> :CtrlPMRUFiles<cr>
nmap <D-S-Left> :tabprevious<cr>
nmap <D-S-Right> :tabnext<cr>
"Select characters/lines with arrow keys
nmap <S-Up> v<Up>
nmap <S-Down> v<Down>
nmap <S-Left> v<Left>
nmap <S-Right> v<Right>
vmap <S-Up> <Up>
vmap <S-Down> <Down>
vmap <S-Left> <Left>
vmap <S-Right> <Right>
imap <S-Up> <Esc>v<Up>
imap <S-Down> <Esc>v<Down>
imap <S-Left> <Esc>v<Left>
imap <S-Right> <Esc>v<Right>
"---------- Auto-Cmd ----------"
augroup custom
"Clear all previous auto-commands
autocmd!
"Auto source the .vimrc file when saving
autocmd BufWritePost .vimrc source %
augroup END