-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
125 lines (111 loc) · 3.15 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
runtime bundle/vim-pathogen/autoload/pathogen.vim " load pathogen from custom location
call pathogen#runtime_append_all_bundles() " pathogen start
call pathogen#helptags() " the pathogen call search the vim plugins on bundles
set mouse=a
"Color scheme
syntax on
colorscheme molokai
let g:molokai_original = 0
set t_Co=256
"Indent options
set expandtab
set tabstop=2
set shiftwidth=2
set softtabstop=2
set shiftround
set autoindent
set smartindent
"Search
set hlsearch
set incsearch
set ignorecase
set autochdir "Switch current directory
set number "Number line
set spell spelllang=en
filetype plugin on
filetype indent on
map <silent> <leader><cr> :nohls<CR>
map <silent> ,n :nohls<CR>
set encoding=utf8
set ruler " show line position
set list " show hidden chars
" hidden chars representation
if has('unix')
set listchars=tab:^T,eol:¬
else
set listchars=tab:^T,eol:$
endif
set backup " backup files
set backupdir=/tmp,. " backup files
set directory=/tmp,. " swap files
"Save file position
"autocomplete code
"print tabs
"show white spaces on EOL
set showmatch
set cursorline
set cursorcolumn
"hi CursorColumn ctermbg=5
"Status text
set laststatus=2
"set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]%{fugitive#statusline()}
"set statusline=
"" Status
"set statusline+=%5*\ %-3m\
"" File name
"set statusline+=%1*%F\
"" File format
"set statusline+=%2*\ %{&ff=='unix'?'\\n':(&ff=='mac'?'\\r':'\\r\\n')}\
"" Encoding
"set statusline+=%3*\ [%{&fenc!=''?&fenc:&enc}]\
"" File type
"set statusline+=%1*\ [%Y]\
"" Lines / Cols
"set statusline+=%4*\ [%04l/%03c]\
"" Byte
"set statusline+=%2*\ 0x%04.4B\
"" Time
"set statusline+=%1*\ %-16{strftime(\"%Y-%m-%d\ %H:%M\")}\
"" Status
"" Git
"set statusline+=%5*\ %{fugitive#statusline()}\
hi User1 guifg=#112605 guibg=SkyBlue gui=italic
hi User2 guifg=#391100 guibg=#d3905c gui=italic
hi User3 guifg=#292b00 guibg=#f4f597 gui=italic
hi User4 guifg=#051d00 guibg=#7dcc7d gui=italic
hi User5 guifg=#002600 guibg=SandyBrown gui=italic
set omnifunc=on " autocomplete function
set completeopt=menu,preview " autocomplete function
set wildmenu " command-line completion
set scrolloff=3 " lines before EOF
set backup " backup files
set backupdir=/tmp,. " backup files
set directory=/tmp,. " swap files
autocmd BufWinLeave * silent! mkview
autocmd BufWinEnter * silent! loadview
highlight ExtraWhitespace ctermbg=215 guibg=SandyBrown
autocmd BufWinEnter * match ExtraWhitespace /^\t*\zs \+\|[ ]\{1,}$/
"para evitar errores xD
cmap W w
cmap WQ wq
cmap Wq wq
cmap wQ wq
cmap Q q
"Guardado rapido
let mapleader = ","
let g:mapleader = ","
nmap <leader>w :w!<cr>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Spell checking
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" " Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>
" " Shortcuts using <leader>
map <leader>sn ]s
map <leader>sp [s
map <leader>sa zg
map <leader>s? z=
" " Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
autocmd vimenter * if !argc() | NERDTree | endif