diff options
-rw-r--r-- | keys/which-key.vim | 19 | ||||
-rw-r--r-- | plug-config/asynctask.vim | 61 | ||||
-rw-r--r-- | plug-config/start-screen.vim | 6 | ||||
-rw-r--r-- | themes/spaceline.vim | 2 | ||||
-rw-r--r-- | utils/tasks.ini | 35 | ||||
-rw-r--r-- | vim-plug/plugins.vim | 4 |
6 files changed, 122 insertions, 5 deletions
diff --git a/keys/which-key.vim b/keys/which-key.vim index cb684da8..52ee1f0d 100644 --- a/keys/which-key.vim +++ b/keys/which-key.vim @@ -78,6 +78,24 @@ let g:which_key_map.b = { \ '?' : ['Buffers' , 'fzf-buffer'] , \ } +" k is for task +let g:which_key_map.k = { + \ 'name' : '+task' , + \ 'c' : [':AsyncTask file-compile' , 'compile file'], + \ 'b' : [':AsyncTask project-build' , 'build project'], + \ 'e' : [':AsyncTaskEdit' , 'edit local tasks'], + \ 'f' : [':AsyncTaskFzf' , 'find task'], + \ 'g' : [':AsyncTaskEdit!' , 'edit global tasks'], + \ 'h' : [':AsyncTaskList!' , 'list hidden tasks'], + \ 'l' : [':CocList tasks' , 'list tasks'], + \ 'm' : [':AsyncTaskMacro' , 'macro help'], + \ 'o' : [':copen' , 'open task view'], + \ 'r' : [':AsyncTask file-run' , 'run file'], + \ 'p' : [':AsyncTask project-run' , 'run project'], + \ 'x' : [':cclose' , 'close task view'], + \ } + " \ 'l' : [':AsyncTaskList' , 'list tasks'], + " s is for search let g:which_key_map.s = { \ 'name' : '+search' , @@ -185,6 +203,7 @@ let g:which_key_map.t = { \ 'n' : [':FloatermNew node' , 'node'], \ 'N' : [':FloatermNew nnn' , 'nnn'], \ 'p' : [':FloatermNew python' , 'python'], + \ 'm' : [':FloatermNew lazynpm' , 'npm'], \ 'r' : [':FloatermNew ranger' , 'ranger'], \ 't' : [':FloatermToggle' , 'toggle'], \ 'y' : [':FloatermNew ytop' , 'ytop'], diff --git a/plug-config/asynctask.vim b/plug-config/asynctask.vim index 4830e037..81d12fdb 100644 --- a/plug-config/asynctask.vim +++ b/plug-config/asynctask.vim @@ -1 +1,62 @@ let g:asyncrun_open = 6 +let g:asynctasks_term_pos = 'bottom' +" let g:asynctasks_term_pos = 'top' +" let g:asynctasks_term_pos = 'tab' +" let g:asynctasks_term_pos = 'external' +let g:asynctasks_extra_config = ['~/.config/nvim/utils/tasks.ini'] +" let current_tasks = asynctasks#list("") + +function! s:fzf_sink(what) + let p1 = stridx(a:what, '<') + if p1 >= 0 + let name = strpart(a:what, 0, p1) + let name = substitute(name, '^\s*\(.\{-}\)\s*$', '\1', '') + if name != '' + exec "AsyncTask ". fnameescape(name) + endif + endif +endfunction + +function! s:fzf_task() + let rows = asynctasks#source(&columns * 48 / 100) + let source = [] + for row in rows + let name = row[0] + let source += [name . ' ' . row[1] . ' : ' . row[2]] + endfor + let opts = { 'source': source, 'sink': function('s:fzf_sink'), + \ 'options': '+m --nth 1 --inline-info --tac' } + if exists('g:fzf_layout') + for key in keys(g:fzf_layout) + let opts[key] = deepcopy(g:fzf_layout[key]) + endfor + endif + call fzf#run(opts) +endfunction + +command! -nargs=0 AsyncTaskFzf call s:fzf_task() + +" Available Variables +" $(VIM_FILEPATH) # File name of current buffer with full path. +" $(VIM_FILENAME) # File name of current buffer without path. +" $(VIM_FILEDIR) # Full path of current buffer without the file name. +" $(VIM_FILEEXT) # File extension of current buffer. +" $(VIM_FILETYPE) # File type (value of &ft in vim) +" $(VIM_FILENOEXT) # File name of current buffer without path and extension. +" $(VIM_PATHNOEXT) # Current file name with full path but without extension. +" $(VIM_CWD) # Current directory (which :pwd returns). +" $(VIM_RELDIR) # File path relativize to current directory. +" $(VIM_RELNAME) # File name relativize to current directory. +" $(VIM_ROOT) # Project root directory. +" $(VIM_CWORD) # Word under cursor. +" $(VIM_CFILE) # File name under cursor. +" $(VIM_CLINE) # Cursor line number in current buffer +" $(VIM_GUI) # has('gui_runnin')? +" $(VIM_VERSION) # Value of v:version. +" $(VIM_COLUMNS) # Current screen width. +" $(VIM_LINES) # Current screen height. +" $(VIM_SVRNAME) # Value of v:servername. +" $(VIM_PRONAME) # Name of current project root directory +" $(VIM_DIRNAME) # Name of current directory +" $(VIM_INIFILE) # Full path name of current ini (.tasks) file. +" $(VIM_INIHOME) # Where the ini file locates. diff --git a/plug-config/start-screen.vim b/plug-config/start-screen.vim index 2e926721..28d7f649 100644 --- a/plug-config/start-screen.vim +++ b/plug-config/start-screen.vim @@ -1,9 +1,9 @@ let g:startify_custom_header = [ - \ ' _ __ _ __ ___ __ ___ ', + \ ' _ __ _ __ ___ __ ___', \ ' / |/ / __(_)_ _ / |/ /__ _____/ / |_ |', - \ ' / / |/ / / ` \ / /|_/ / _ `/ __/ _ \ / __/ ', - \ ' /_/|_/|___/_/_/_/_/ /_/ /_/\_,_/\__/_//_/ /____/ ', + \ ' / / |/ / / ` \ / /|_/ / _ `/ __/ _ \ / __/', + \ ' /_/|_/|___/_/_/_/_/ /_/ /_/\_,_/\__/_//_/ /____/', \] let g:startify_session_dir = '~/.config/nvim/session' diff --git a/themes/spaceline.vim b/themes/spaceline.vim new file mode 100644 index 00000000..584ca36e --- /dev/null +++ b/themes/spaceline.vim @@ -0,0 +1,2 @@ +let g:spaceline_seperate_style= 'none' +let g:spaceline_colorscheme = 'mach2' diff --git a/utils/tasks.ini b/utils/tasks.ini new file mode 100644 index 00000000..31daa6d2 --- /dev/null +++ b/utils/tasks.ini @@ -0,0 +1,35 @@ + +[file-compile] +command:javac="$(VIM_FILEPATH)" +output=terminal +cwd=$(VIM_FILEDIR) + +[file-run] +command="$(VIM_FILEPATH)" +command:c,cpp="$(VIM_PATHNOEXT)" +command:java="$(VIM_PATHNOEXT)" +command:go="$(VIM_PATHNOEXT)" +command:python=python "$(VIM_FILENAME)" +command:make=make -f "$(VIM_FILENAME)" run +command:emake=emake -e "$(VIM_FILENAME)" +command:javascript=node "$(VIM_FILENAME)" +command:sh=sh "$(VIM_FILENAME)" +command:lua=lua "$(VIM_FILENAME)" +command:perl=perl "$(VIM_FILENAME)" +command:ruby=ruby "$(VIM_FILENAME)" +command:zsh=zsh "$(VIM_FILENAME)" +command:bash=bash "$(VIM_FILENAME)" +command:fish=fish "$(VIM_FILENAME)" +command:php=php "$(VIM_FILENAME)" +command:erlang=escript "$(VIM_FILENAME)" +command:ps1=powershell -file "$(VIM_FILENAME)" +command:scala=scala "$(VIM_FILENAME)" +command:haskell=ghci "$(VIM_FILENAME)" +command:applescript=osascript "$(VIM_FILENAME)" +command:vim=:source % +output=terminal +cwd=$(VIM_FILEDIR) +save=2 + +[project-run] +command:javascript,css,jsx="npm start" diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index a9e2d14e..db0458e3 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -10,7 +10,7 @@ call plug#begin('~/.config/nvim/autoload/plugged') " jsx syntax support Plug 'maxmellon/vim-jsx-pretty' - + Plug 'suy/vim-context-commentstring' " Change dates fast Plug 'tpope/vim-speeddating' @@ -45,7 +45,7 @@ call plug#begin('~/.config/nvim/autoload/plugged') Plug 'sheerun/vim-polyglot' " Cool Icons Plug 'ryanoasis/vim-devicons' - " Auto pairs for '(' '[' '{' + " Auto pairs for '(' '[' '{' Plug 'jiangmiao/auto-pairs' " Closetags Plug 'alvan/vim-closetag' |