aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <codyfh@gmail.com>2017-02-19 17:03:15 -0700
committerCody Hiar <codyfh@gmail.com>2017-02-19 17:03:15 -0700
commit6fec4d9cf1f34c79080934b341044da05db3da94 (patch)
treed8ecfc82c88a0be3ce2fa4cb6b78c95d8f21107f
parent9d333906d2fb92af4ab2b25eecdfaee6d146a78e (diff)
Big revamp of settings after watching the thoughtbot video
-rw-r--r--plugin/vim-options.vim582
1 files changed, 164 insertions, 418 deletions
diff --git a/plugin/vim-options.vim b/plugin/vim-options.vim
index 4c722f4..c0cf4dd 100644
--- a/plugin/vim-options.vim
+++ b/plugin/vim-options.vim
@@ -1,139 +1,45 @@
"-----------------------------------------------------------------------------------------------------------------------
-" User Preferences
-"-----------------------------------------------------------------------------------------------------------------------
-filetype plugin indent on " Make sure indenting works
-let mapleader="\\" " Set map leader
-set omnifunc=syntaxcomplete#Complete " Set Autocomplete
+" General Settings
+"----------------------------------------------------------------------------------------------------------------------
+filetype plugin on " Enable default plugins
+let mapleader="\<Space>"
+" Vim options that neovim has turned on but vim has off/ignores
+set nocompatible " Vim is non-compatible with vi. Neovim ignores this
+set wildmenu " Turn on wildmenu for vim, Neovim defaults to on
+set incsearch " Shows results for '/' search as you are typing the search
+set hlsearch " After a '/' search, highlight the matches
+" Regular settings
+set path=** " Set path to look at all directories under current root
+set wildignore=*/app/cache,*/vendor,*/env,*.pyc,*/venv,*/__pycache__ " Wildmenu will ignore these folder/file types
set expandtab " Expand tabs into spaces
-set tabstop=2 " Number of space that tab counts for
-set shiftwidth=2 " Number of spaces for each autoindent
-set textwidth=0 " Maximium width of text that is being inserted. 0 disables it
-set history=1000 " Set history of : commands
-set autoindent " Copy the indentation from the previous line
-set cindent " Get ammount of indent according to C indent rules
-set relativenumber " Use relative numbers
-set number " Show line numbers
-set nowrap " Turn off TextWrapping
-set completeopt=longest,menuone " Autocomplete options
-set wildmode=longest,list " Completion mode for wildchar
-set backspace=indent,eol,start " Backspace over everything in insert mode
-set laststatus=2 " Show the status bar always
-set wildignore=*/app/cache,*/vendor,*/env,*.pyc,*/venv " Ignore useless files
-set splitright " Horizontal Splits go to the right
-set splitbelow " Vertical Splits go underneath
-set incsearch " Move cursor to matched string
-set hlsearch " Turn off highlight search
-set sessionoptions+=tabpages,globals " Include tab names in sessions
-set backup
-set background=dark
+set shiftwidth=0 " Make shiftwidth value the same as tabstop
+set history=1000 " Set number of ':' commands
+set relativenumber " Use relative numbers in the sidebar
+set number " Show line numbers in side bar
+set nowrap " Turn off text wrapping long lines
+set completeopt=menu,preview,noinsert " default is menu,preview. Don't insert text until selection is made
+set wildmode=list:longest,full " wildmenu show list and completes longest, second tab completes full and cycles
+set splitright " New windows split to the right of current one
+set splitbelow " New windows split below the current one
+set sessionoptions+=globals " Append globals to the default session options
+" Custom status line
set statusline=
-set statusline+=%1*\ %02c\ "Colnr
-set statusline+=%2*\ » "RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
-set statusline+=%3*\ %<%F\ "File+path
-set statusline+=%2*\«
-set statusline+=%2*\ %=\ %l/%L\ (%02p%%)\ "Rownumber/total (%)
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Specific settings for Neovim/Vim
-"-----------------------------------------------------------------------------------------------------------------------
-if has('nvim')
- let EditorDir=$HOME.'/.config/nvim/'
- let CacheDir='./.vimcache/'
- " Create the dirs
- silent! execute '!mkdir -p '.CacheDir.'backup'
- " Set Backup dirs
- set backupdir=.vimcache/backup/
- set directory=.vimcache/swp/
- let g:ctrlp_clear_cache_on_exit = 0
- let g:ctrlp_cache_dir = CacheDir.'ctrlp'
- let g:deoplete#sources#jedi#python_path = '/usr/bin/python3'
- let g:syntastic_python_python_exec = '/usr/bin/python3'
-else
- " Vim Options
- let EditorDir=$HOME.'/.vim/'
- let CacheDir=$HOME.'/.vim/vim-files/'
- set lazyredraw "Stops flashing from command above and helps save on processing
- set backupdir=~/.vim/vim-files/backups/
- set directory=~/.vim/vim-files/swaps/
- let g:vimwiki_list = [{'path': '~/Wiki/wiki', 'path_html': '~/Wiki/wiki_html/', 'ext': '.markdown'}]
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Custom Mappings
-"-----------------------------------------------------------------------------------------------------------------------
-" Turn off syntax highlighting
-nnoremap <leader><space> :noh<CR>
-" Hardcore Mode
-noremap <Up> <NOP>
-noremap <Down> <NOP>
-noremap <Left> <NOP>
-noremap <Right> <NOP>
-" Highlighting in vim leaves your cursor wherever you ended at
-:vmap y ygv<ESC>
-" Formating a json file
-com! Formatjson %!python -m json.tool
-" Command for figuring out highlight group
-map <leader>hi :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" . " FG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"fg#")<CR>
-" Faster saving
-noremap <leader>w :update<CR>
-" Faster quiting
-noremap <leader>q :quit!<CR>
-" Visually select pasted text
-nnoremap gp `[v`]
-" Yank withouth newline
-nmap yY ^y$
-" Window switching
-nnoremap <C-J> <C-W><C-J>
-nnoremap <C-K> <C-W><C-K>
-nnoremap <C-L> <C-W><C-L>
-nnoremap <C-H> <C-W><C-H>
-nnoremap <C-]> <C-w><C-]>
-nnoremap <C-w>t :tabnew<CR>
-" allows incsearch highlighting for range commands
-cnoremap <leader>t <CR>:t''<CR>
-cnoremap <leader>T <CR>:t''<CR>ddkP
-cnoremap <leader>m <CR>:m''<CR>
-cnoremap <leader>M <CR>:m''<CR>ddkP
-cnoremap <leader>d <CR>:d<CR>``
-function! SaveSession()
- :mksession! CacheDir.'session.vim'
- :echo 'Session Saved!'
-endfunction
-
-function! RestoreSession()
- :source CacheDir.'session.vim'
-endfunction
-nnoremap <leader>ee :call SaveSession()<CR>
-nnoremap <leader>er :call RestoreSession()<CR>
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" FileType Options
-"-----------------------------------------------------------------------------------------------------------------------
-au FileType xml setlocal equalprg=xmllint\ --format\ --recover\ -\ 2>/dev/null " File ident on xml files
-autocmd FileType html set tabstop=2|set shiftwidth=2
-autocmd FileType htmljinja set tabstop=2|set shiftwidth=2
-autocmd FileType python set tabstop=4|set shiftwidth=4
-autocmd FileType php set tabstop=4|set shiftwidth=4 noexpandtab!
-autocmd FileType sh set tabstop=4|set shiftwidth=4
-autocmd FileType make set tabstop=4|set shiftwidth=4 noexpandtab
-autocmd FileType haskell set tabstop=8|set shiftwidth=4|set softtabstop=4
-au BufRead,BufNewFile *.twig set syntax=htmljinja
-au BufRead,BufNewFile *.html set syntax=htmljinja
-au BufNewFile,BufRead *.yml set filetype=yaml
-au BufNewFile,BufRead *.sls set filetype=yaml
-au BufNewFile,BufRead *.inc set filetype=php
-au BufNewFile,BufRead *.module set filetype=php
-au BufRead,BufNewFile *.ejs set syntax=htmljinja
-au BufRead,BufNewFile *.md set filetype=markdown
+set statusline+=%1*\ %02c\ " Color
+set statusline+=%2*\ » " RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+set statusline+=%3*\ %<%F\ " File+path
+set statusline+=%2*\« " LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+set statusline+=%2*\ %=\ %l/%L\ (%02p%%)\ " Rownumber/total (%)
+" Set spacing of file types
+autocmd FileType html setlocal tabstop=2
+autocmd FileType htmljinja setlocal tabstop=2
+autocmd FileType php setlocal tabstop=4
+autocmd FileType python setlocal tabstop=4
+autocmd FileType sh setlocal tabstop=4
+autocmd FileType make setlocal tabstop=4 noexpandtab
+" Make netrw prettier
+let g:netrw_banner = 0 " Hide the banner
+let g:netrw_liststyle = 3 " Tree view
+let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+' " Hide dotfiles
"-----------------------------------------------------------------------------------------------------------------------
@@ -141,8 +47,7 @@ au BufRead,BufNewFile *.md set filetype=markdown
"-----------------------------------------------------------------------------------------------------------------------
" Color/Theming Options
"-----------------------------------------------------------------------------------------------------------------------
-" Solarized cterm colors
-" 0 = almost dark blue // 1 = red
+" 0 = dark background // 1 = red
" 2 = green // 3 = yellow
" 4 = light blue // 5 = pink
" 6 = cyan // 7 = beige
@@ -151,14 +56,23 @@ au BufRead,BufNewFile *.md set filetype=markdown
" 12 = light grey // 13 = purple
" 14 = grey // 15 = white
" 16 = black
-"
-"Colorscheme
-colorscheme gruvbox
-" Vim diff Colors
+syntax enable " Enable syntax highlighiting of files
+colorscheme gruvbox " Set the colorscheme
+set background=dark " Use dark colorscheme
+" Set vimdiff colors, make it easier to read
highlight DiffAdd cterm=BOLD ctermfg=NONE ctermbg=22
highlight DiffDelete cterm=BOLD ctermfg=NONE ctermbg=52
highlight DiffChange cterm=BOLD ctermfg=NONE ctermbg=23
highlight DiffText cterm=BOLD ctermfg=NONE ctermbg=23
+" Set syntax of files that vim doesn't recognize
+au BufRead,BufNewFile *.twig set syntax=htmljinja
+au BufRead,BufNewFile *.html set syntax=htmljinja
+au BufNewFile,BufRead *.yml set filetype=yaml
+au BufNewFile,BufRead *.sls set filetype=yaml
+au BufNewFile,BufRead *.inc set filetype=php
+au BufNewFile,BufRead *.module set filetype=php
+au BufRead,BufNewFile *.ejs set syntax=htmljinja
+au BufRead,BufNewFile *.md set filetype=markdown
" Highligh current cursorline
hi CursorLineNR cterm=bold ctermfg=226
" Status line colors per mode
@@ -172,109 +86,84 @@ highlight SignColumn cterm=NONE ctermfg=0 ctermbg=8
"-----------------------------------------------------------------------------------------------------------------------
-" Nerdtree Plugin
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/nerdtree/plugin/NERD_tree.vim'))
- nnoremap <leader>n :NERDTreeTabsToggle<CR>
- nnoremap <leader>m :NERDTreeFind<CR>
- let g:NERDTreeShowLineNumbers=1
- let g:NERDTreeDirArrows=0
- let g:NERDTreeWinSize = 40
- let g:NERDTreeIgnore = ['\.pyc$']
- let g:NERDTreeDirArrows = 1
- let g:NERDTreeDirArrowExpandable = '▸'
- let g:NERDTreeDirArrowCollapsible = '▾'
- let g:NERDTreeMapOpenSplit = 's'
- let g:NERDTreeMapPreviewSplit = 'gs'
- let g:NERDTreeMapOpenVSplit = 'v'
- let g:NERDTreeMapPreviewVSplit = 'gv'
-
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Emmet Plugin
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/emmet-vim/plugin/emmet.vim'))
- let g:use_emmet_complete_tag = 1
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Indent Lines Plugin
+" Vim vs Neovim settings
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/vim-indent-guides/plugin/indent_guides.vim'))
- let g:indent_guides_enable_on_vim_startup = 1
- let g:indent_guides_auto_colors = 0
- let g:indent_guides_exclude_filetypes =['help', 'nerdtree']
- let g:indent_guides_start_level = 2
- let g:indent_guides_guide_size = 1
- autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=235
- autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=237
- autocmd VimEnter,Colorscheme * :IndentGuidesEnable
+if has('nvim')
+ let EditorDir=$HOME.'/.config/nvim/'
+ silent! execute '!mkdir -p .vimcache/backup'
+ " Set Backup dirs
+ set backupdir=.vimcache/backup/
+ set directory=.vimcache/swp/
+ let g:syntastic_python_python_exec = '/usr/bin/python3'
+else
+ " Vim Options
+ let EditorDir=$HOME.'/.vim/'
+ " Set Backup dirs
+ set backupdir=~/.vim/vim-files/backups/
+ set directory=~/.vim/vim-files/swaps/
endif
-"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
-" Vdebug Plugin
+" Custom functions
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/vdebug/plugin/vdebug.vim'))
- let g:vdebug_options = {
- \ "watch_window_style" : 'compact',
- \ "port" : 9000,
- \ "path_maps" : {
- \ "/vagrant": "/Users/codyhiar/Sites",
- \ "/var/www/html": "/Users/hiarc/Sites/inv/redis-api",
- \ "/ask/sites/investopedia.com/web": "/src",
- \ "/ask/sites/inv-taxonomy-service": "/src",
- \ },
- \}
- "Delete all breakpoints
- :command! BR BreakpointRemove *
-endif
+" Taken from ins-completion docs. Tab if only whitespace, autocomplete if there is text
+function! CleverTab()
+ if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
+ return "\<Tab>"
+ else
+ return "\<C-N>"
+ endif
+endfunction
+inoremap <Tab> <C-R>=CleverTab()<CR>
+" Ctags for python project
+command! MakeTagsPython !ctags --languages=python -R .
+" Command for figuring out highlight group
+map <leader>hi :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" . " FG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"fg#")<CR>
+" Turn off syntax highlighting
+nnoremap <leader><leader> :noh<CR>
+" Shortcut for creating a new tab
+nnoremap <C-w>t :tabnew<CR>
+" Formating a json file
+com! Formatjson %!python -m json.tool
+" Visually select pasted text
+nnoremap gp `[v`]
+" Yank withouth newline
+nmap yY ^y$$
+" Function for saving session
+function! SaveSession()
+ :mksession! 'session.vim'
+ :echo 'Session Saved!'
+endfunction
+nnoremap <leader>ee :call SaveSession()<CR>
+" Function for restoring session
+function! RestoreSession()
+ :source 'session.vim'
+endfunction
+nnoremap <leader>er :call RestoreSession()<CR>
+" Vimdiff commands
+nnoremap <leader>du :diffupdate<CR>
+nnoremap <leader>dd :diffget<CR>
+nnoremap <leader>df :diffput<CR>
+nnoremap _ [c
+nnoremap = ]c
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
-" Unite Plugin
+" Ack Searching
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/unite.vim/plugin/unite.vim'))
- let g:unite_enable_start_insert = 1
- let g:unite_split_rule = "botright"
- let g:unite_force_overwrite_statusline = 0
- let g:unite_winheight = 10
- let g:unite_source_history_yank_enable = 1
- let g:unite_source_rec_max_cache_files=5000
- let g:unite_source_rec_async_command =
- \ ['ack', '-f', '--nofilter']
- " Check to see if the plugin is loaded before callinging
- if exists('g:loaded_unite')
- call unite#custom_source('file_rec,file_rec/async,file_mru,file,buffer,grep',
- \ 'ignore_pattern', join([
- \ '\.git/',
- \ ], '\|'))
- call unite#filters#matcher_default#use(['matcher_fuzzy'])
- call unite#filters#sorter_default#use(['sorter_rank'])
- endif
- nnoremap <space>s :<C-u>Unite -buffer-name=buffer buffer -winheight=40<cr>
- nnoremap <space>y :<C-u>Unite -buffer-name=yank history/yank -quick-match -max-multi-lines=1 -winheight=40<cr>
- " Custom mappings for the unite buffer
- autocmd FileType unite call s:unite_settings()
- function! s:unite_settings()
- " Enable navigation with control-j and control-k in insert mode
- let b:SuperTabDisabled=1
- imap <buffer> <C-j> <Plug>(unite_select_next_line)
- imap <buffer> <C-k> <Plug>(unite_select_previous_line)
- imap <silent><buffer><expr> <C-x> unite#do_action('split')
- imap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
- imap <silent><buffer><expr> <C-t> unite#do_action('tabopen')
+if !empty(glob(EditorDir.'plugged/ack.vim/plugin/ack.vim'))
+ nnoremap <space>/ :call AckSearch()<CR>
+ function! AckSearch()
+ call inputsave()
+ let term = input('Search: ')
+ call inputrestore()
+ if !empty(term)
+ execute "Ack! '" . term . "'"
+ endif
endfunction
endif
"-----------------------------------------------------------------------------------------------------------------------
@@ -282,41 +171,22 @@ endif
"-----------------------------------------------------------------------------------------------------------------------
-" SuperTab Plugin
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/supertab/plugin/supertab.vim'))
- let g:SuperTabMappingForward = '<tab>'
- let g:SuperTabMappingBackward = '<s-tab>'
- let g:SuperTabLongestHighlight = 0
- let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Ultisnips
+" CamelCaseMotion
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/ultisnips/plugin/UltiSnips.vim'))
- let g:UltiSnipsEditSplit="vertical"
- let g:UltiSnipsListSnippets="<c-s>"
- let g:UltiSnipsExpandTrigger="<tab>"
- let g:UltiSnipsJumpForwardTrigger="<c-k>"
- let g:UltiSnipsJumpBackwardTrigger="<c-l>"
- :command! SNIPS tabnew ~/.config/nvim/plugged/vim-snippets/snippets
+if !empty(glob(EditorDir.'plugged/CamelCaseMotion/plugin/camelcasemotion.vim'))
+ map <silent> ,w <Plug>CamelCaseMotion_w
+ map <silent> ,e <Plug>CamelCaseMotion_e
+ map <silent> ,b <Plug>CamelCaseMotion_b
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
-" Fugitive
+" Fugitive
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob(EditorDir.'plugged/vim-fugitive/plugin/fugitive.vim'))
- nnoremap <leader>gc :Gcommit --verbose<CR>
- nnoremap <leader>gd :Gdiff<CR>
- nnoremap <leader>gl :Glog<CR>
- nnoremap <leader>gb :Gblame<CR>
+ " Command for toggling git status
function! ToggleGStatus()
if buflisted(bufname('.git/index'))
bd .git/index
@@ -326,57 +196,33 @@ if !empty(glob(EditorDir.'plugged/vim-fugitive/plugin/fugitive.vim'))
endfunction
command ToggleGStatus :call ToggleGStatus()
nnoremap <leader>gs :ToggleGStatus<CR>
- " Diff commands
- nnoremap <leader>du :diffupdate<CR>
- nnoremap <leader>dd :diffget<CR>
- nnoremap <leader>df :diffput<CR>
- nnoremap _ [c
- nnoremap = ]c
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
-" Python-Syntax
+" Indent Lines Plugin
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/python-syntax/syntax/python.vim'))
- let python_highlight_all = 1
+if !empty(glob(EditorDir.'plugged/vim-indent-guides/plugin/indent_guides.vim'))
+ let g:indent_guides_enable_on_vim_startup = 1
+ let g:indent_guides_auto_colors = 0
+ let g:indent_guides_exclude_filetypes =['help', 'nerdtree']
+ let g:indent_guides_start_level = 2
+ let g:indent_guides_guide_size = 1
+ autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=235
+ autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=237
+ autocmd VimEnter,Colorscheme * :IndentGuidesEnable
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
-" CtrlP Plugin
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/ctrlp.vim/plugin/ctrlp.vim'))
- let g:ctrlp_working_path_mode = 'a'
- let g:ctrlp_map = '<Space>p'
- let g:ctrlp_status_func = {
- \ 'main': 'CtrlP_main_status',
- \ 'prog': 'CtrlP_progress_status',
- \ }
- let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
- " Arguments: focus, byfname, s:regexp, prv, item, nxt, marked
- " a:1 a:2 a:3 a:4 a:5 a:6 a:7
- fu! CtrlP_main_status(...)
- let regex = a:3 ? '%#CtrlP_Violet#regex %*' : ''
- let prv = '%#CtrlP_Purple# '.a:4.' %*'
- let item = '%#CtrlP_IPurple# '.a:5.' %*'
- let nxt = '%#CtrlP_Purple# '.a:6.' %*'
- let byfname = '%#CtrlP_Violet# '.a:2.' %*'
- let dir = '%#CtrlP_Purple# '.fnamemodify(getcwd(), ':~').' %*'
- retu prv . item . nxt . '%#CtrlP_Violet#%=%*%<' . byfname . regex . dir
- endf
- fu! CtrlP_progress_status(...)
- let len = '%#Function# '.a:1.' %*'
- let dir = ' %=%<%#LineNr# '.getcwd().' %*'
- retu len.dir
- endf
- hi CtrlP_Purple ctermfg=7 ctermbg=4
- hi CtrlP_IPurple ctermfg=4 ctermbg=7
- hi CtrlP_Violet ctermfg=7 ctermbg=8
+" Ledger
+"-----------------------------------------------------------------------------------------------------------------------
+if !empty(glob(EditorDir.'plugged/SimpylFold/ftplugin/python/SimpylFold.vim'))
+ au BufNewFile,BufRead *.ldg,*.ledger setf ledger | comp ledger
endif
"-----------------------------------------------------------------------------------------------------------------------
@@ -393,161 +239,61 @@ endif
"-----------------------------------------------------------------------------------------------------------------------
-" Dev-icons
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/vim-devicons/plugin/webdevicons.vim'))
- let g:webdevicons_enable_nerdtree = 1
- let g:webdevicons_enable = 1
- let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1
- let g:WebDevIconsUnicodeDecorateFolderNodes = 1
- let g:DevIconsEnableFoldersOpenClose = 1
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Dash
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/dash.vim/plugin/dash.vim'))
- nnoremap K :Dash<CR>
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Deoplete
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/deoplete.nvim/plugin/deoplete.vim'))
- let g:deoplete#enable_at_startup = 1
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" CamelCaseMotion
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/CamelCaseMotion/plugin/camelcasemotion.vim'))
- map <silent> ,w <Plug>CamelCaseMotion_w
- map <silent> ,e <Plug>CamelCaseMotion_e
- map <silent> ,b <Plug>CamelCaseMotion_b
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Vim JSON
+" Python-Syntax
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/vim-json/indent/json.vim'))
- let g:vim_json_syntax_conceal = 0
+if !empty(glob(EditorDir.'plugged/python-syntax/syntax/python.vim'))
+ let python_highlight_all = 1
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
-" Ack Searching
+" Taboo
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/ack.vim/plugin/ack.vim'))
- nnoremap <space>/ :call AckSearch()<CR>
- function! AckSearch()
+if !empty(glob(EditorDir.'plugged/taboo.vim/plugin/taboo.vim'))
+ au BufNewFile,BufRead *.ldg,*.ledger setf ledger | comp ledger
+ function! RenameTab()
call inputsave()
- let term = input('Search: ')
+ let term = input('Tabname: ')
call inputrestore()
if !empty(term)
- execute "Ack '" . term . "'"
- endif
- endfunction
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-
-
-
-"-----------------------------------------------------------------------------------------------------------------------
-" Syntastic
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/syntastic/plugin/syntastic.vim'))
- let g:syntastic_php_checkers = ['php', 'phpcs']
- let g:syntastic_php_phpcs_args = "--standard=".$HOME."/PEARish.xml,PSR2,Symfony2"
- let g:syntastic_javascript_checkers = ['eslint']
- let g:syntastic_always_populate_loc_list = 1
- let g:syntastic_auto_loc_list = 0
- let g:syntastic_check_on_open = 1
- let g:syntastic_check_on_wq = 1
- let g:syntastic_aggregate_errors = 1
- let g:syntastic_mode_map = { 'mode': 'active' }
- function! ToggleSyntasticMode()
-python << EOF
-import vim
-import ast
-value = dict(vim.eval('g:syntastic_mode_map'))
-vim.command('let l:syntastic_current_mode = \''+value['mode']+'\'')
-EOF
- SyntasticToggleMode
- if l:syntastic_current_mode == 'passive'
- SyntasticCheck
+ execute ":TabooRename " . term
endif
endfunction
- nnoremap <leader>s :call ToggleSyntasticMode()<CR>
+ nnoremap <leader>r :call RenameTab()<CR>
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
-" Toggle List
+" Vdebug Plugin
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/vim-togglelist/plugin/togglelist.vim'))
- noremap <leader>[ :lprevious<CR>
- noremap <leader>] :lnext<CR>
- noremap <leader>p :ll<CR>
- " Disable the mapping it overwrites leader q
- let g:toggle_list_no_mappings = 1
- nmap <script> <silent> <leader>l :call ToggleLocationList()<CR>
+if !empty(glob(EditorDir.'plugged/vdebug/plugin/vdebug.vim'))
+ let g:vdebug_options = {
+ \ "watch_window_style" : 'compact',
+ \ "port" : 9000,
+ \ "path_maps" : {
+ \ "/var/www/html": "/Users/hiarc/myprojectdir",
+ \ },
+ \}
+ "Delete all breakpoints
+ :command! BR BreakpointRemove *
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
-" SimplyFold
+" Vim JSON
"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/SimpylFold/ftplugin/python/SimpylFold.vim'))
- let g:SimpylFold_docstring_preview = 1
- " Needed for some issues
- autocmd BufWinEnter *.py setlocal foldexpr=SimpylFold(v:lnum) foldmethod=expr
- autocmd BufWinLeave *.py setlocal foldexpr< foldmethod<
- nnoremap <space>a za
+if !empty(glob(EditorDir.'plugged/vim-json/indent/json.vim'))
+ let g:vim_json_syntax_conceal = 0
endif
"-----------------------------------------------------------------------------------------------------------------------
-"-----------------------------------------------------------------------------------------------------------------------
-" Ledger
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/SimpylFold/ftplugin/python/SimpylFold.vim'))
- au BufNewFile,BufRead *.ldg,*.ledger setf ledger | comp ledger
-endif
-"-----------------------------------------------------------------------------------------------------------------------
-"-----------------------------------------------------------------------------------------------------------------------
-" Taboo
-"-----------------------------------------------------------------------------------------------------------------------
-if !empty(glob(EditorDir.'plugged/taboo.vim/plugin/taboo.vim'))
- au BufNewFile,BufRead *.ldg,*.ledger setf ledger | comp ledger
- function! RenameTab()
- call inputsave()
- let term = input('Tabname: ')
- call inputrestore()
- if !empty(term)
- execute ":TabooRename " . term
- endif
- endfunction
- nnoremap <leader>r :call RenameTab()<CR>
-endif
-"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
" Basic movements (h, j, k, l) require a number prefix. Break bad habits
@@ -595,5 +341,5 @@ command! ToggleDisablingOfNonCountedBasicMotions :call ToggleDisablingOfBasicMot
command! DisableNonCountedBasicMotions :call SetDisablingOfBasicMotionsIfNonCounted(1)
command! EnableNonCountedBasicMotions :call SetDisablingOfBasicMotionsIfNonCounted(0)
-" Call this function to enable God Mode
+" Call this function to enable Hard Mode
"DisableNonCountedBasicMotions