diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl new file mode 100644 index 0000000..338f1b8 --- /dev/null +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl @@ -0,0 +1,33 @@ +(module dotfiles.plugin.compe + {autoload {nvim aniseed.nvim}}) + +(set nvim.o.completeopt "menuone,noselect") + +(let [compe (require :compe)] + (when compe + (compe.setup + {:enabled true + :autocomplete true + :debug false + :min_length 1 + :preselect "enable" + :throttle_time 80 + :source_timeout 200 + :incomplete_delay 400 + :max_abbr_width 100 + :max_kind_width 100 + :max_menu_width 100 + :documentation true + :source {:path true + :buffer true + :calc true + :nvim_lsp true + :nvim_lua true + :conjure true + :vsnip true}}))) + +(nvim.ex.inoremap " compe#complete()") +(nvim.ex.inoremap " compe#confirm('')") +(nvim.ex.inoremap " compe#close('')") +(nvim.ex.inoremap " compe#scroll({ 'delta': +4 })") +(nvim.ex.inoremap " compe#scroll({ 'delta': -4 })") diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl index fece06a..ce1a866 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl @@ -3,6 +3,7 @@ {a aniseed.core u dotfiles.util nvim aniseed.nvim + nu aniseed.nvim.util } }) @@ -34,6 +35,23 @@ ; -- vim.lsp.buf.execute_command({command = cmd, arguments = arguments}) ; -- end +(defn lsp-execute-command [cmd ...] + (let [buf-uri (vim.uri_from_bufnr 0) + cursor (vim.api.nvim_win_get_cursor 0) + r (- (a.first cursor) 1) + c (a.second cursor) + args [buf-uri r c] + ] + (vim.lsp.buf.execute_command {:command cmd + :arguments (merge args {...})}) + )) + + +(nu.fn-bridge :LspExecuteCommand :dotfiles.plugin.lspconfig :lsp-execute-command {:return false}) + +; (nu.fn-bridge +; :DeleteHiddenBuffers +; :dotfiles.mapping :delete-hidden-buffers) (def core-nmappings { @@ -54,6 +72,7 @@ {:clojure { ; -- buf_set_keymap('n', 'cn', "lua LspExecuteCommand('clean-ns')", opts) +; -- buf_set_keymap('n', 'cn', "lua LspExecuteCommand('clean-ns')", opts) ; -- buf_set_keymap('n', 'ref', "lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\"))", opts) ; -- buf_set_keymap('x', 'ref', "lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\"))", opts) ; -- buf_set_keymap('n', 'id', "lua LspExecuteCommand('inline-symbol')", opts) @@ -91,6 +110,7 @@ (bind-client-mappings client) + (nvim.ex.autocmd :BufWritePre : :lua "vim.lsp.buf.formatting_sync()") ; -- vim.api.nvim_command[[autocmd BufWritePre lua vim.lsp.buf.formatting_sync()]] ; -- vim.api.nvim_command[[autocmd BufWritePre lua vim.lsp.buf_request_sync(vim.api.nvim_get_current_buf(), 'workspace/executeCommand', {command = 'clean-ns', arguments = {vim.uri_from_bufnr(0), vim.api.nvim_win_get_cursor(0)[1], vim.api.nvim_win_get_cursor(0)[2]}, title = 'Clean Namespace'})]] diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/telescope.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/telescope.fnl index 6610fa5..db9703e 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/telescope.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/telescope.fnl @@ -5,13 +5,13 @@ (telescope.setup {:defaults - {:vimgrep_arguments ["ag" "--nocolor=never" "--noheading" + {:vimgrep_arguments ["ag" "--nocolor" "--noheading" "--files-with-matches" "--number" "--column" - "--smart-case" "--hidden" "--follow" + "--smart-case" "--hidden" "--follow" "--skip-vcs-ignores" "-g" "!.git/"]}}) -(util.lnnoremap :ff "Telescope find_files hidden=true") +(util.lnnoremap :ff "Telescope git_files hidden=true") (util.lnnoremap :f- "Telescope file_browser") (util.lnnoremap :fg "Telescope live_grep") (util.lnnoremap :* "Telescope grep_string") diff --git a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl index 9df125f..2e7a64a 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl @@ -28,35 +28,37 @@ (def- packages { - :wbthomason/packer.nvim {:mod :packer} + :Olical/aniseed {} + :Olical/conjure {} ; Clojure + :Olical/fennel.vim {} ; Fennel + :airblade/vim-gitgutter {} ; Git :airblade/vim-gitgutter {} ; Git :clojure-vim/vim-jack-in {} ; Conjure support - jack-in with nrepl dependencies - :thecontinium/asyncomplete-conjure.vim {} - :tpope/vim-dispatch {} ; Conjure support - jack-in with nrepl dependencies - :Olical/conjure {} ; Clojure - :Olical/aniseed {} - :Olical/fennel.vim {} ; Fennel - :neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config + :hashivim/vim-terraform {} ; Terraform + :hrsh7th/nvim-compe {:mod :compe} ; autocomplete + :jiangmiao/auto-pairs {} ; backets, parens, and quotes in pairs :kabouzeid/nvim-lspinstall {} ; NeoVim lsp server installs - :airblade/vim-gitgutter {} ; Git -:kovisoft/paredit {} -; :luochen1990/rainbow {} -:jiangmiao/auto-pairs {} ; backets, parens, and quotes in pairs -:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :treesitter} -:hashivim/vim-terraform {} ; Terraform -:skywind3000/asyncrun.vim {} ; :AsyncRun -:tpope/vim-classpath {} -:tpope/vim-fugitive {} ; Git -:tpope/vim-git {} ; Git Commit Message -:tpope/vim-pathogen {} -:tpope/vim-surround {} -:tpope/vim-repeat {} -:tpope/vim-unimpaired {} -:tpope/vim-vinegar {} -:radenling/vim-dispatch-neovim {} ; Clojure - :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]] :mod :telescope} - :p00f/nvim-ts-rainbow {} - :norcalli/nvim-colorizer.lua {:mode :colorizer} + :kovisoft/paredit {} + :neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config + :norcalli/nvim-colorizer.lua {:mode :colorizer} + :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]] :mod :telescope} + :nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :treesitter} + :p00f/nvim-ts-rainbow {} + :radenling/vim-dispatch-neovim {} ; Clojure + :skywind3000/asyncrun.vim {} ; :AsyncRun + :tami5/compe-conjure {} ; autocomplete using conjure as a source + :tpope/vim-classpath {} + :tpope/vim-dispatch {} ; Conjure support - jack-in with nrepl dependencies + :tpope/vim-fugitive {} ; Git + :tpope/vim-git {} ; Git Commit Message + :tpope/vim-pathogen {} + :tpope/vim-repeat {} + :tpope/vim-surround {} + :tpope/vim-unimpaired {} + :tpope/vim-vinegar {} + :wbthomason/packer.nvim {:mod :packer} + ; :luochen1990/rainbow {} + ; :thecontinium/asyncomplete-conjure.vim {} } ; :tpope/vim-fireplace {} ; Clojure