diff --git a/nvim/bundles.vim b/nvim/bundles.vim index b33da71..e69de29 100644 --- a/nvim/bundles.vim +++ b/nvim/bundles.vim @@ -1,26 +0,0 @@ -call dein#add('Shougo/deoplete.nvim') -call dein#add('Shougo/neosnippet') -call dein#add('christoomey/vim-tmux-navigator') -call dein#add('cocopon/lightline-hybrid.vim') -call dein#add('editorconfig/editorconfig-vim') -call dein#add('haya14busa/incsearch.vim') -call dein#add('itchyny/lightline.vim') -call dein#add('junegunn/fzf', { 'merged': 0 }) -call dein#add('jiangmiao/auto-pairs') -call dein#add('junegunn/fzf.vim', { 'depends': 'fzf' }) -call dein#add('junegunn/gv.vim') -call dein#add('justinmk/vim-sneak') -call dein#add('maxbrunsfeld/vim-yankstack') -call dein#add('sheerun/vim-polyglot') -call dein#add('tpope/vim-commentary') -call dein#add('tpope/vim-fugitive') -call dein#add('tpope/vim-ragtag') -call dein#add('tpope/vim-repeat') -call dein#add('tpope/vim-surround') -call dein#add('tpope/vim-unimpaired') -call dein#add('tpope/vim-vinegar') -call dein#add('w0ng/vim-hybrid') -call dein#add('w0rp/ale') -call dein#add('webgefrickel/vim-snippets') -call dein#add('wellle/targets.vim') -call dein#add('wellle/tmux-complete.vim') diff --git a/nvim/init.vim b/nvim/init.vim index 3ca15a1..09646fe 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -8,7 +8,27 @@ set runtimepath+=~/.config/nvim/dein/repos/github.com/Shougo/dein.vim " let dein handle all the plugins and bundles call dein#begin(expand('~/.config/nvim/dein')) call dein#add('Shougo/dein.vim') -source ~/.config/nvim/bundles.vim +call dein#add('Shougo/deoplete.nvim') +call dein#add('Shougo/neosnippet') +call dein#add('christoomey/vim-tmux-navigator') +call dein#add('editorconfig/editorconfig-vim') +call dein#add('junegunn/fzf', { 'merged': 0 }) +call dein#add('junegunn/fzf.vim', { 'depends': 'fzf' }) +call dein#add('junegunn/gv.vim') +call dein#add('maxbrunsfeld/vim-yankstack') +call dein#add('sheerun/vim-polyglot') +call dein#add('tpope/vim-commentary') +call dein#add('tpope/vim-fugitive') +call dein#add('tpope/vim-ragtag') +call dein#add('tpope/vim-repeat') +call dein#add('tpope/vim-surround') +call dein#add('tpope/vim-unimpaired') +call dein#add('tpope/vim-vinegar') +call dein#add('w0ng/vim-hybrid') +call dein#add('w0rp/ale') +call dein#add('webgefrickel/vim-snippets') +call dein#add('wellle/targets.vim') +call dein#add('wellle/tmux-complete.vim') call dein#end() filetype plugin indent on @@ -17,6 +37,7 @@ syntax on " load the default config and mappings source ~/.config/nvim/config.vim source ~/.config/nvim/autocommands.vim +source ~/.config/nvim/statusline.vim source ~/.config/nvim/keymappings.vim source ~/.config/nvim/leaderkeys.vim source ~/.config/nvim/plugins.vim diff --git a/nvim/plugins.vim b/nvim/plugins.vim index af3a795..de2b61e 100644 --- a/nvim/plugins.vim +++ b/nvim/plugins.vim @@ -4,36 +4,20 @@ let g:deoplete#enable_smart_case = 1 let g:deoplete#auto_complete_delay = 150 let g:deoplete#auto_completion_start_length = 4 -inoremap deoplete#smart_close_popup().doorboy#map_backspace() -inoremap deoplete#smart_close_popup().doorboy#map_backspace() +inoremap deoplete#smart_close_popup()."\" +inoremap deoplete#smart_close_popup()."\" inoremap =deoplete_cr_function() function! s:deoplete_cr_function() abort return deoplete#close_popup() . "\" endfunction -" fugitive + vimagit +" fugitive nnoremap gs :Gstatus20+ nnoremap gd :Gvdiff20+ nnoremap gc :Gcommit20+ nnoremap gw :Gwrite20+ nnoremap gb :Gblame20+ -nnoremap gm :Magit - -" incsearch -let g:incsearch#auto_nohlsearch = 1 -let g:incsearch#consistent_n_direction = 1 -let g:incsearch#magic = '\v' - -map / (incsearch-forward) -map ? (incsearch-backward) -map g/ (incsearch-stay) -map n (incsearch-nohl-n) -map N (incsearch-nohl-N) -map * (incsearch-nohl-*) -map # (incsearch-nohl-#) -map g* (incsearch-nohl-g*) -map g# (incsearch-nohl-g#) " neosnippet let g:neosnippet#disable_runtime_snippets = { "_": 1 } @@ -46,12 +30,6 @@ imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) xmap (neosnippet_expand_target) -" sneak -let g:sneak#use_ic_scs = 1 -let g:sneak#map_netrw = 1 -let g:sneak#s_next = 1 -let g:sneak#streak = 1 - " ale let g:ale_lint_on_save = 1 let g:ale_lint_on_text_changed = 0 @@ -66,68 +44,7 @@ let g:ale_linters = { " fzf nnoremap , :Files nnoremap . :Buffers -nnoremap g :GFiles -nnoremap c :GFiles? nnoremap l :Lines nnoremap a :Ag nnoremap r :History: -" lightline -let g:lightline = { - \ 'colorscheme': 'hybrid', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ], - \ 'right': [ [ 'lineinfo' ], [ 'fileformat', 'fileencoding', 'filetype' ] ] - \ }, - \ 'component_function': { - \ 'modified': 'LightlineModified', - \ 'readonly': 'LightlineReadonly', - \ 'fugitive': 'LightlineFugitive', - \ 'filename': 'LightlineFilename', - \ 'fileformat': 'LightlineFileformat', - \ 'filetype': 'LightlineFiletype', - \ 'fileencoding': 'LightlineFileencoding', - \ 'mode': 'LightlineMode', - \ } -\ } - -function! LightlineModified() - return &ft =~ 'help' ? '' : &modified ? 'ɱ' : &modifiable ? '' : 'ɯ' -endfunction - -function! LightlineReadonly() - return &ft !~? 'help' && &readonly ? 'ɹ' : '' -endfunction - -function! LightlineFilename() - return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') . - \ (&ft == 'unite' ? unite#get_status_string() : - \ '' != expand('%:t') ? expand('%:t') : '[No Name]') . - \ (LightlineModified() != '' ? ' ' . LightlineModified() : '') . - \ (ALEGetStatusLine() != 'OK' ? ' - ' . ALEGetStatusLine() : '') -endfunction - -function! LightlineFugitive() - if exists("*fugitive#head") - let _ = fugitive#head() - return strlen(_) ? 'ɓ '._ : '' - endif - return '' -endfunction - -function! LightlineFileformat() - return winwidth(0) > 70 ? &fileformat : '' -endfunction - -function! LightlineFiletype() - return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : '' -endfunction - -function! LightlineFileencoding() - return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : '' -endfunction - -function! LightlineMode() - let fname = expand('%:t') - return winwidth(0) > 70 ? lightline#mode() : '' -endfunction diff --git a/nvim/statusline.vim b/nvim/statusline.vim new file mode 100644 index 0000000..3300af8 --- /dev/null +++ b/nvim/statusline.vim @@ -0,0 +1,23 @@ +function! GitBranch() + return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") +endfunction + +function! StatuslineGit() + let l:branchname = GitBranch() + return strlen(l:branchname) > 0?' '.l:branchname.' ':'' +endfunction + +set statusline= +set statusline+=%#PmenuSel# +set statusline+=%{StatuslineGit()} +set statusline+=%#LineNr# +set statusline+=\ %f +set statusline+=%m\ +set statusline+=%= +set statusline+=%#CursorColumn# +set statusline+=\ %y +set statusline+=\ %{&fileencoding?&fileencoding:&encoding} +set statusline+=\[%{&fileformat}\] +set statusline+=\ %p%% +set statusline+=\ %l:%c +set statusline+=\