-
Notifications
You must be signed in to change notification settings - Fork 0
/
ansible_vimrc
135 lines (118 loc) · 3.86 KB
/
ansible_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
126
127
128
129
130
131
132
133
134
135
set nocompatible
set number
" to search using find add curent dir and all it's subdir intp path
set path+=**
set wildmenu
"suffixes added because gf will find if no extension is mentioned
set suffixesadd+=.yml
set suffixesadd+=.yaml
if !has('nvim')
set ttymouse=xterm2
endif
" add color in statusba
if !has('gui_running')
set t_Co=256
endif
set noshowmode "status bar already shows it
set laststatus=2
" enable mouse
" set mouse=a
colorscheme murphy
au BufWinLeave *.* colorscheme default
"autocmd FileType yaml setlocal ai ts=2 sw=2
autocmd FileType sh,yaml,yaml.ansible,vim setlocal shiftwidth=2 tabstop=2 expandtab
" Consider any .yml and .yaml files as yaml.ansible
au BufRead,BufNewFile *.yml,*.yaml set filetype=yaml.ansible
if has('nvim')
"let $TERM = 'putty-256color'
call plug#begin('~/.vim/plugged')
" Plug 'neoclide/coc.nvim'
Plug 'dense-analysis/ale'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()
else
call plug#begin('~/.vim/plugged')
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
call plug#end()
endif
call plug#begin('~/.vim/plugged')
"call plug#begin()
" Plug 'vim-syntastic/syntastic'
Plug 'huawenyu/vim-log-syntax' " To show errors in log file different color
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
"Plug 'garbas/vim-snipmate'
" Optional:
Plug 'honza/vim-snippets'
"ultisnips is snippet engine
Plug 'sirver/ultisnips'
Plug 'phenomenes/ansible-snippets'
Plug 'pearofducks/ansible-vim'
" Plug 'ctrlpvim/ctrlp.vim' " replaced by FZF
Plug 'junegunn/fzf' | Plug 'junegunn/fzf.vim'
Plug 'burntsushi/ripgrep'
Plug 'itchyny/lightline.vim'
"Plug 'vim-airline/vim-airline'
"Plug 'vim-airline/vim-airline-themes'
Plug 'Yggdroot/indentLine'
Plug 'dense-analysis/ale'
"Plug 'scrooloose/nerdtree'
"Plug 'jistr/vim-nerdtree-tabs'
Plug 'raimondi/delimitmate' "Parenthesis closing
Plug 'dyng/ctrlsf.vim'
Plug 'mhinz/vim-startify'
Plug 'voldikss/vim-floaterm'
"Plug 'ptzz/lf.vim' " lf file manager"
"Plug 'rbgrouleff/bclose.vim' " In Neovim to install lf this is required"
Plug 'tomasr/molokai'
call plug#end()
" Mapping section
nnoremap <C-p> :Files<Cr>
nnoremap <C-f> :BLines<Cr>
nmap <C-S-f> :CtrlSF
" Search word under cursor in multiple files
nmap <leader>* :CtrlSF "<C-R><C-W>"<CR>
"
" Syntastic settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
"IndentLine
let g:indentLine_enabled = 1
let g:indentLine_concealcursor = 0
let g:indentLine_char = '|'
let g:indentLine_faster = 1
"NERDTree configuration
let g:NERDTreeChDirMode=2
let g:NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__']
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$']
let g:NERDTreeShowBookmarks=1
let g:nerdtree_tabs_focus_on_files=1
let g:NERDTreeMapOpenInTabSilent = '<RightMouse>'
let g:NERDTreeWinSize = 50
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite
nnoremap <silent> <F2> :NERDTreeFind<CR>
nnoremap <silent> <F3> :NERDTreeToggle<CR>
" Trigger configuration. You need to change this to something other than <tab> if you use one of the following:
" - https://github.com/Valloric/YouCompleteMe
" - https://github.com/nvim-lua/completion-nvim
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
#Deoplete will help auto-completion
let g:deoplete#enable_at_startup = 1
" ripgrep
if executable('rg')
set grepprg=rg\ --vimgrep
endif
" Install yamllint and ansible-lint to show errors
" pip3 install yamllint
" pip3 install ansible-lint