-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
149 lines (118 loc) · 3.83 KB
/
Copy pathvimrc
File metadata and controls
149 lines (118 loc) · 3.83 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
"============================================================
" Michael Ikua's Vim configuration
"============================================================
set nocompatible " be iMproved, required
filetype off " required
"======================== Vundle ============================
" set the runtime path to include Vundle and initialize
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"My plugins
Plugin 'itchyny/lightline.vim'
"Plugin 'tpope/vim-fugitive'
Plugin 'psliwka/vim-smoothie'
Plugin 'tmhedberg/SimpylFold'
"Plugin 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
"===================== Vundle End ===========================
"================== Lightline Config ========================
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'colorscheme': 'darcula',
\ 'component': {
\ 'lineinfo': ' %3l:%-2v',
\ },
\ 'component_function': {
\ 'readonly': 'LightlineReadonly',
\ 'fugitive': 'LightlineFugitive'
\ },
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': '', 'right': '' }
\ }
function! LightlineReadonly()
return &readonly ? '' : ''
endfunction
function! LightlineFugitive()
if exists('*fugitive#head')
let branch = fugitive#head()
return branch !=# '' ? ''.branch : ''
endif
return ''
endfunction
"================== Lightline Config End=======================
" SimpylFold options
let g:SimpylFold_fold_import = 0
function! FoldText()
let foldsize = (v:foldend - v:foldstart)
return getline(v:foldstart).' ('.foldsize.' lines)'
endfunction
setlocal foldtext=FoldText()
" Enable folding with the spacebar
nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
" Option for tabline
set laststatus=2
set noshowmode
"For theme
set background=dark
" Allow backspacing over everything in insert mode.
set backspace=indent,eol,start
" Show the cursor position all the time
set ruler
" Enable syntax highlighting
syntax on
" Enhance command-line completion
set wildmenu
" Backup, swap and undo settings
set backup
set undofile
set backupdir=~/.vim/backups//
set directory=~/.vim/swaps//
set undodir=~/.vim/undo//
" Enable line numbers
set nonumber
set relativenumber
" Make tabs as wide as four spaces
"set tabstop=4
" Highlight current line
" set cursorline
" for python files
"au BufNewFile,BufRead *.py
" \ set tabstop=4 |
" \ set softtabstop=4 |
" \ set shiftwidth=4 |
" \ set textwidth=79 |
" \ set expandtab |
" \ set autoindent |
" \ set fileformat=unix
"au BufNewFile,BufRead *.js, *.html, *.css
" \ set tabstop=2 |
" \ set softtabstop=2 |
" \ set shiftwidth=2 |
" \ set expandtab
" Turn on smart indenting
filetype indent on
set smartindent
" Custom Identation config
autocmd FileType html setlocal shiftwidth=2 tabstop=2 expandtab
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 expandtab
autocmd FileType sh setlocal shiftwidth=4 tabstop=4
autocmd FileType zsh setlocal shiftwidth=4 tabstop=4
autocmd FileType c setlocal shiftwidth=4 tabstop=4
" Add optional packages.
"
" The matchit plugin makes the % command work better, but it is not backwards
" compatible.
" The ! means the package won't be loaded right away but when plugins are
" loaded during initialization.
if has('syntax') && has('eval')
packadd! matchit
endif