This commit is contained in:
ManjaroOne666 2018-12-02 21:31:01 +00:00
parent 3f1f70a71e
commit 21b3126ad4
5 changed files with 142 additions and 112 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ wal-colors.vim
wal_example-dark.vim wal_example-dark.vim
wal_example-light.vim wal_example-light.vim
vim/autoload/plug.vim vim/autoload/plug.vim
.is-dev

View File

@ -2,6 +2,7 @@
"coc.preferences.triggerAfterInsertEnter": false, "coc.preferences.triggerAfterInsertEnter": false,
"coc.preferences.autoTrigger": "none", "coc.preferences.autoTrigger": "none",
"coc.preferences.triggerSignatureHelp": true, "coc.preferences.triggerSignatureHelp": true,
"coc.preferences.diagnostic.enable": false,
"coc.preferences.diagnostic.warningSign": "λ", "coc.preferences.diagnostic.warningSign": "λ",
"coc.preferences.diagnostic.errorSign": "Λ", "coc.preferences.diagnostic.errorSign": "Λ",
"coc.preferences.diagnostic.infoSign": "λ", "coc.preferences.diagnostic.infoSign": "λ",

View File

@ -4,9 +4,8 @@ set shiftwidth=4
set textwidth=79 set textwidth=79
nnoremap <silent> <buffer> <F5> :call SaveAndExecute('python')<CR>
" vnoremap <silent> <buffer> <F5> :<C-u>call SaveAndExecutePython()<CR>
set foldmethod=indent set foldmethod=indent
set foldnestmax=1 set foldnestmax=1
nnoremap <silent> <buffer> <F5> :call SaveAndExecute('python')<CR>
command! CTagsPython !ctags -R --fields=+l --languages=python --python-kinds=-iv -f ./.tags-py $(python -c "import os, sys; print(' '.join('{}'.format(d) for d in sys.path if os.path.isdir(d)))")

View File

@ -1,3 +1,4 @@
setlocal keywordprg=:help setlocal keywordprg=:help
setlocal iskeyword+=:
nnoremap <buffer> <F5> :w \| source %<cr> nnoremap <buffer> <F5> :w \| source %<cr>

246
vimrc
View File

@ -1,5 +1,6 @@
" #plugins {{{ "
" #plugins {{{
if empty(glob('~/.vim/autoload/plug.vim'))"{{{ if empty(glob('~/.vim/autoload/plug.vim'))"{{{
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
@ -12,6 +13,133 @@ if !has('nvim')
Plug '~/.config/vim/vim/bundle/vim-learnxiny' Plug '~/.config/vim/vim/bundle/vim-learnxiny'
" #Ctrlp {{{
Plug 'ctrlpvim/ctrlp.vim'
" :h ctrlp-commands
" :h ctrlp-extensions
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'undo']
if executable('ag')
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
" Use ag over grep
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ node_modules
endif
"}}}
" #Netrw {{{
let g:netrw_liststyle=3
let g:netrw_list_hide='^\..*'
let g:netrw_preview = 0
"}}}
" #MatchTagAlways{{{
" https://github.com/Valloric/MatchTagAlways
Plug 'Valloric/MatchTagAlways'
let g:mta_filetypes = {
\ 'jinja' : 1,
\ 'html' : 1,
\ 'vue' : 1,
\ 'xhtml' : 1,
\ 'xml' : 1,
\}
"}}}
" #Obsession{{{
Plug 'tpope/vim-obsession'
"}}}
" #switch {{{
"https://github.com/AndrewRadev/switch.vim
Plug 'AndrewRadev/switch.vim'
let g:switch_mapping = '<space>-'
let g:switch_custom_definitions = [
\ ['0', '1'],
\ ['ease-in', 'ease-out', 'ease-in-out', 'linear'],
\ ['auto', 'none'],
\ ['left', 'right'],
\ ['top', 'bottom'],
\ ['row', 'column'],
\ ['relative', 'absolute', 'fixed']
\ ]
"}}}
" #switch {{{
"https://github.com/AndrewRadev/switch.vim
Plug 'AndrewRadev/switch.vim'
let g:switch_mapping = '<space>-'
let g:switch_custom_definitions = [
\ ['0', '1'],
\ ['ease-in', 'ease-out', 'ease-in-out', 'linear'],
\ ['auto', 'none'],
\ ['left', 'right'],
\ ['top', 'bottom'],
\ ['row', 'column'],
\ ['relative', 'absolute', 'fixed']
\ ]
"}}}
" #undotree {{{
Plug 'mbbill/undotree'
nnoremap <space>ut :UndotreeToggle<cr>
"}}}
" #tcomment_vim{{{
" https://github.com/tomtom/tcomment_vim
Plug 'tomtom/tcomment_vim'
"}}}
" #vim-easy-align {{{
" https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
"}}}
" #vim-qlist {{{
" Original: https://github.com/romainl/vim-qlist
Plug 'studio-vx/vim-qlist'
"}}}
" #vim-repeat{{{
" https://github.com/tpope/vim-repeat
Plug 'tpope/vim-repeat'
"}}}
" #vim-rsi{{{
"https://github.com/tpope/vim-rsi
Plug 'tpope/vim-rsi'
"}}}
" #vim-surround{{{
Plug 'tpope/vim-surround'
"}}}
" #vim-fugitive{{{
" https://github.com/tpope/vim-fugitive/blob/master/README.markdown
Plug 'tpope/vim-fugitive'
nnoremap <silent> <space>gs :Gstatus<CR>
nnoremap <silent> <space>gd :tabedit %<CR>:Gdiff<CR>
nnoremap <silent> <space>gc :Gcommit<CR>
nnoremap <silent> <space>gl :Glog<CR>
nnoremap <silent> <space>gp :Gpush<CR>:copen<CR>
"}}}
" #wakatime{{{
" https://wakatime.com/vim
Plug 'wakatime/vim-wakatime'
"}}}
if filereadable(expand('.is-dev'))
" #ALE {{{ " #ALE {{{
" https://github.com/w0rp/ale " https://github.com/w0rp/ale
Plug 'w0rp/ale' Plug 'w0rp/ale'
@ -92,25 +220,6 @@ if !has('nvim')
" #css3-syntax{{{ " #css3-syntax{{{
Plug 'hail2u/vim-css3-syntax' Plug 'hail2u/vim-css3-syntax'
"}}}
" #Ctrlp {{{
Plug 'ctrlpvim/ctrlp.vim'
" :h ctrlp-commands
" :h ctrlp-extensions
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'undo']
if executable('ag')
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
" Use ag over grep
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ node_modules
endif
"}}} "}}}
" #emmet-vim {{{ " #emmet-vim {{{
" https://github.com/mattn/emmet-vim " https://github.com/mattn/emmet-vim
@ -167,28 +276,6 @@ if !has('nvim')
nnoremap <space>ie :InlineEdit<cr> nnoremap <space>ie :InlineEdit<cr>
"}}}
" #MatchTagAlways{{{
" https://github.com/Valloric/MatchTagAlways
Plug 'Valloric/MatchTagAlways'
let g:mta_filetypes = {
\ 'jinja' : 1,
\ 'html' : 1,
\ 'vue' : 1,
\ 'xhtml' : 1,
\ 'xml' : 1,
\}
"}}}
" #Netrw {{{
let g:netrw_liststyle=3
let g:netrw_list_hide='^\..*'
let g:netrw_preview = 0
"}}}
" #Obsession{{{
Plug 'tpope/vim-obsession'
"}}} "}}}
" #php.vim{{{ " #php.vim{{{
" https://github.com/StanAngeloff/php.vim " https://github.com/StanAngeloff/php.vim
@ -211,22 +298,6 @@ let g:mta_filetypes = {
" #scss-syntax{{{ " #scss-syntax{{{
Plug 'cakebaker/scss-syntax.vim' Plug 'cakebaker/scss-syntax.vim'
"}}}
" #switch {{{
"https://github.com/AndrewRadev/switch.vim
Plug 'AndrewRadev/switch.vim'
let g:switch_mapping = '<space>-'
let g:switch_custom_definitions = [
\ ['0', '1'],
\ ['ease-in', 'ease-out', 'ease-in-out', 'linear'],
\ ['auto', 'none'],
\ ['left', 'right'],
\ ['top', 'bottom'],
\ ['row', 'column'],
\ ['relative', 'absolute', 'fixed']
\ ]
"}}} "}}}
" #tagbar {{{ " #tagbar {{{
Plug 'majutsushi/tagbar' Plug 'majutsushi/tagbar'
@ -329,28 +400,10 @@ let g:mta_filetypes = {
set completefunc=CompleteSnippets set completefunc=CompleteSnippets
"}}} "}}}
" #undotree {{{
Plug 'mbbill/undotree'
nnoremap <space>ut :UndotreeToggle<cr>
"}}}
" #tcomment_vim{{{
" https://github.com/tomtom/tcomment_vim
Plug 'tomtom/tcomment_vim'
"}}}
" #vim-dispatch{{{ " #vim-dispatch{{{
" https://github.com/tpope/vim-dispatch " https://github.com/tpope/vim-dispatch
Plug 'tpope/vim-dispatch' Plug 'tpope/vim-dispatch'
"}}}
" #vim-easy-align {{{
" https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
"}}} "}}}
" #vim-gutentags {{{ " #vim-gutentags {{{
" https://github.com/ludovicchabant/vim-gutentags " https://github.com/ludovicchabant/vim-gutentags
@ -426,20 +479,6 @@ let g:mta_filetypes = {
" augroup END " augroup END
""}}} ""}}}
" #vim-repeat{{{
" https://github.com/tpope/vim-repeat
Plug 'tpope/vim-repeat'
"}}}
" #vim-rsi{{{
"https://github.com/tpope/vim-rsi
Plug 'tpope/vim-rsi'
"}}}
" #vim-surround{{{
Plug 'tpope/vim-surround'
"}}}
" #vim-SyntaxRange{{{ " #vim-SyntaxRange{{{
" https://github.com/inkarkat/vim-SyntaxRange " https://github.com/inkarkat/vim-SyntaxRange
" Plug 'inkarkat/vim-SyntaxRange' " Plug 'inkarkat/vim-SyntaxRange'
@ -483,27 +522,13 @@ let g:mta_filetypes = {
" Using studio-vx fork " Using studio-vx fork
Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' } Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' }
"}}}
" #vim-fugitive{{{
" https://github.com/tpope/vim-fugitive/blob/master/README.markdown
Plug 'tpope/vim-fugitive'
nnoremap <silent> <space>gs :Gstatus<CR>
nnoremap <silent> <space>gd :tabedit %<CR>:Gdiff<CR>
nnoremap <silent> <space>gc :Gcommit<CR>
nnoremap <silent> <space>gl :Glog<CR>
nnoremap <silent> <space>gp :Gpush<CR>:copen<CR>
"}}} "}}}
" #vim-git{{{ " #vim-git{{{
" https://github.com/tpope/vim-git " https://github.com/tpope/vim-git
Plug 'tpope/vim-git' Plug 'tpope/vim-git'
"}}} "}}}
" #wakatime{{{ endif
" https://wakatime.com/vim
Plug 'wakatime/vim-wakatime'
"}}}
call plug#end() call plug#end()
endif endif
@ -969,7 +994,8 @@ set lazyredraw
set backupdir=~/.vimtmp set backupdir=~/.vimtmp
set directory=~/.vimtmp set directory=~/.vimtmp
set tags+=./.tags,.tags;/home/ray/ " the ;/home/ray tells vim to stop searching at /home/ray
set tags+=./.tags,.tags,./tags-py,.tags-py;/home/ray/
" persisitent undo file " persisitent undo file
set undodir=/home/ray/.vim/undodir set undodir=/home/ray/.vim/undodir
@ -997,7 +1023,7 @@ set hlsearch
" set previewheight=24 " set previewheight=24
" set splitbelow " set splitbelow
set completeopt=longest,menuone,preview set completeopt=longest,menuone
set nospell set nospell
set spelllang=en_gb set spelllang=en_gb
@ -1110,7 +1136,7 @@ nnoremap <PageUp> :bprevious<CR>
nnoremap <PageDown> :bnext<CR> nnoremap <PageDown> :bnext<CR>
" alias for :tjump <cword> " alias for :tjump <cword>
nnoremap <space>tj g<C-]> nnoremap <space>tj g<C-]>
" alias for @ptjump <cword> " alias for :ptjump <cword>
nnoremap <space>tp <C-w>g} nnoremap <space>tp <C-w>g}
"}}} "}}}
@ -1450,7 +1476,9 @@ function! GetStatus(isactive) abort "{{{
let l:statusline .= ' ' . l:separator let l:statusline .= ' ' . l:separator
let l:statusline .= '%#StatusLineWarning#%{gutentags#statusline("", "", "☢")}' if exists('gutentags#statusline')
let l:statusline .= '%#StatusLineWarning#%{gutentags#statusline("", "", "☢")}'
endif
return l:statusline return l:statusline