diff --git a/home/.config/nvim/asynctasks.ini b/home/.config/nvim/asynctasks.ini new file mode 100644 index 0000000..37d9cfa --- /dev/null +++ b/home/.config/nvim/asynctasks.ini @@ -0,0 +1,61 @@ +{cmake} + +[project-init] +command=mkdir build && cd build && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. && ln -s compile_commands.json .. +cwd= +errorformat= +output=terminal +[project-build] +command=cmake --build build +cwd= +errorformat=%f:%l:%c --> %m +output=terminal +[project-run] +command=build/$(VIM_PRONAME) +cwd= +output=terminal + +{meson} + +[project-init] +command=mkdir build && meson setup --wipe build && ln -s build/compile_commands.json . +cwd= +errorformat= +output=terminal +[project-build] +command=ninja -C build +cwd= +errorformat=%f:%l:%c --> %m +output=terminal +[project-run] +command=build/$(VIM_PRONAME) +cwd= +output=terminal + +{single} + +[file-run] +command="$(VIM_FILEPATH)" +command:c,cpp="$(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:lua=lua "$(VIM_FILENAME)" +command:perl=perl "$(VIM_FILENAME)" +command:ruby=ruby "$(VIM_FILENAME)" +command:sh=sh "$(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 diff --git a/home/.config/nvim/lua/modules/tools.lua b/home/.config/nvim/lua/modules/tools.lua index 05dc404..46bb336 100644 --- a/home/.config/nvim/lua/modules/tools.lua +++ b/home/.config/nvim/lua/modules/tools.lua @@ -70,6 +70,16 @@ function M.neogit_conf() } end +function M.asynctasks_conf() + -- vim.g.asyncrun_open = 8 -- when using quickfix window (output=terminal is preferable) + vim.g.asyncrun_rootmarks = {'.git', '.svn', '.root', '.hg', '.projectile'} + + vim.g.asynctasks_term_pos = 'bottom' + vim.g.asynctasks_term_rows = 10 + vim.g.asynctasks_config_name = 'tasks.ini' + vim.g.asynctasks_template = '~/.config/nvim/asynctasks.ini' +end + function M.markdown_preview_conf() vim.g.mkdp_refresh_slow = 1 vim.g.mkdp_filetypes = { diff --git a/home/.config/nvim/lua/plugins.lua b/home/.config/nvim/lua/plugins.lua index a882bc5..8ccbec2 100644 --- a/home/.config/nvim/lua/plugins.lua +++ b/home/.config/nvim/lua/plugins.lua @@ -288,6 +288,21 @@ return require('packer').startup( }, config = tools.neogit_conf } + use { + 'skywind3000/asynctasks.vim', + cmd = { + 'AsyncTask', + 'AsyncTaskEdit', + 'AsyncTaskList', + 'AsyncTaskMacro' + }, + wants = 'asyncrun.vim', + requires = {{ + 'skywind3000/asyncrun.vim', + setup = tools.asynctasks_conf, + opt = true + }} + } use { 'iamcco/markdown-preview.nvim', run = 'cd app && yarn install', @@ -354,6 +369,6 @@ return require('packer').startup( use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'} -- Just for benchmarking -- TODO: rest.nvim, parinfer.nvim, editorconfig.nvim, conjure, nvim-spectre, - -- dial.nvim, asynctasks.nvim, hotpot.nvim, rust-tools.nvim, crates.nvim, go.nvim + -- dial.nvim, hotpot.nvim, rust-tools.nvim, crates.nvim, go.nvim end )