continuing dotfiles migration/setup

This commit is contained in:
Proctor
2021-08-17 19:14:06 -05:00
parent 72a5461153
commit 4b8a9fa1df
4 changed files with 84 additions and 29 deletions

View File

@@ -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 "<silent><expr> <C-Space> compe#complete()")
(nvim.ex.inoremap "<silent><expr> <CR> compe#confirm('<CR>')")
(nvim.ex.inoremap "<silent><expr> <C-e> compe#close('<C-e>')")
(nvim.ex.inoremap "<silent><expr> <C-f> compe#scroll({ 'delta': +4 })")
(nvim.ex.inoremap "<silent><expr> <C-d> compe#scroll({ 'delta': -4 })")

View File

@@ -3,6 +3,7 @@
{a aniseed.core {a aniseed.core
u dotfiles.util u dotfiles.util
nvim aniseed.nvim nvim aniseed.nvim
nu aniseed.nvim.util
} }
}) })
@@ -34,6 +35,23 @@
; -- vim.lsp.buf.execute_command({command = cmd, arguments = arguments}) ; -- vim.lsp.buf.execute_command({command = cmd, arguments = arguments})
; -- end ; -- 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 (def core-nmappings
{ {
@@ -54,6 +72,7 @@
{:clojure {:clojure
{ {
; -- buf_set_keymap('n', '<leader>cn', "<cmd>lua LspExecuteCommand('clean-ns')<CR>", opts) ; -- buf_set_keymap('n', '<leader>cn', "<cmd>lua LspExecuteCommand('clean-ns')<CR>", opts)
; -- buf_set_keymap('n', '<leader>cn', "<cmd>lua LspExecuteCommand('clean-ns')<CR>", opts)
; -- buf_set_keymap('n', '<leader>ref', "<cmd>lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\"))<CR>", opts) ; -- buf_set_keymap('n', '<leader>ref', "<cmd>lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\"))<CR>", opts)
; -- buf_set_keymap('x', '<leader>ref', "<cmd>lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\"))<CR>", opts) ; -- buf_set_keymap('x', '<leader>ref', "<cmd>lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\"))<CR>", opts)
; -- buf_set_keymap('n', '<leader>id', "<cmd>lua LspExecuteCommand('inline-symbol')<CR>", opts) ; -- buf_set_keymap('n', '<leader>id', "<cmd>lua LspExecuteCommand('inline-symbol')<CR>", opts)
@@ -91,6 +110,7 @@
(bind-client-mappings client) (bind-client-mappings client)
(nvim.ex.autocmd :BufWritePre :<buffer> :lua "vim.lsp.buf.formatting_sync()")
; -- vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]] ; -- vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]]
; -- vim.api.nvim_command[[autocmd BufWritePre <buffer> 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'})]] ; -- vim.api.nvim_command[[autocmd BufWritePre <buffer> 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'})]]

View File

@@ -5,13 +5,13 @@
(telescope.setup (telescope.setup
{:defaults {:defaults
{:vimgrep_arguments ["ag" "--nocolor=never" "--noheading" {:vimgrep_arguments ["ag" "--nocolor" "--noheading"
"--files-with-matches" "--number" "--column" "--files-with-matches" "--number" "--column"
"--smart-case" "--hidden" "--follow" "--smart-case" "--hidden" "--follow" "--skip-vcs-ignores"
"-g" "!.git/"]}}) "-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 :f- "Telescope file_browser")
(util.lnnoremap :fg "Telescope live_grep") (util.lnnoremap :fg "Telescope live_grep")
(util.lnnoremap :* "Telescope grep_string") (util.lnnoremap :* "Telescope grep_string")

View File

@@ -28,35 +28,37 @@
(def- packages (def- packages
{ {
:wbthomason/packer.nvim {:mod :packer} :Olical/aniseed {}
:Olical/conjure {} ; Clojure
:Olical/fennel.vim {} ; Fennel
:airblade/vim-gitgutter {} ; Git
:airblade/vim-gitgutter {} ; Git :airblade/vim-gitgutter {} ; Git
:clojure-vim/vim-jack-in {} ; Conjure support - jack-in with nrepl dependencies :clojure-vim/vim-jack-in {} ; Conjure support - jack-in with nrepl dependencies
:thecontinium/asyncomplete-conjure.vim {} :hashivim/vim-terraform {} ; Terraform
:tpope/vim-dispatch {} ; Conjure support - jack-in with nrepl dependencies :hrsh7th/nvim-compe {:mod :compe} ; autocomplete
:Olical/conjure {} ; Clojure :jiangmiao/auto-pairs {} ; backets, parens, and quotes in pairs
:Olical/aniseed {}
:Olical/fennel.vim {} ; Fennel
:neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config
:kabouzeid/nvim-lspinstall {} ; NeoVim lsp server installs :kabouzeid/nvim-lspinstall {} ; NeoVim lsp server installs
:airblade/vim-gitgutter {} ; Git :kovisoft/paredit {}
:kovisoft/paredit {} :neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config
; :luochen1990/rainbow {} :norcalli/nvim-colorizer.lua {:mode :colorizer}
:jiangmiao/auto-pairs {} ; backets, parens, and quotes in pairs :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]] :mod :telescope}
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :treesitter} :nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :treesitter}
:hashivim/vim-terraform {} ; Terraform :p00f/nvim-ts-rainbow {}
:skywind3000/asyncrun.vim {} ; :AsyncRun :radenling/vim-dispatch-neovim {} ; Clojure
:tpope/vim-classpath {} :skywind3000/asyncrun.vim {} ; :AsyncRun
:tpope/vim-fugitive {} ; Git :tami5/compe-conjure {} ; autocomplete using conjure as a source
:tpope/vim-git {} ; Git Commit Message :tpope/vim-classpath {}
:tpope/vim-pathogen {} :tpope/vim-dispatch {} ; Conjure support - jack-in with nrepl dependencies
:tpope/vim-surround {} :tpope/vim-fugitive {} ; Git
:tpope/vim-repeat {} :tpope/vim-git {} ; Git Commit Message
:tpope/vim-unimpaired {} :tpope/vim-pathogen {}
:tpope/vim-vinegar {} :tpope/vim-repeat {}
:radenling/vim-dispatch-neovim {} ; Clojure :tpope/vim-surround {}
:nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]] :mod :telescope} :tpope/vim-unimpaired {}
:p00f/nvim-ts-rainbow {} :tpope/vim-vinegar {}
:norcalli/nvim-colorizer.lua {:mode :colorizer} :wbthomason/packer.nvim {:mod :packer}
; :luochen1990/rainbow {}
; :thecontinium/asyncomplete-conjure.vim {}
} }
; :tpope/vim-fireplace {} ; Clojure ; :tpope/vim-fireplace {} ; Clojure