diff --git a/.config/nvim/fnl/ale.fnl b/.config/nvim/fnl/ale.fnl new file mode 100644 index 0000000..524f607 --- /dev/null +++ b/.config/nvim/fnl/ale.fnl @@ -0,0 +1,9 @@ +(set vim.g.omnifunc "ale#completion#OmniFunc") +(set vim.g.ale_fix_on_save 1) +(set vim.g.ale_floating_preview 1) +(set vim.g.ale_floating_window_border [:│ :─ :╭ :╮ :╯ :╰ :│ :─]) +(vim.keymap.set :n :gd "(ale_go_to_definition)" {:noremap true}) +(vim.keymap.set :n :gr "(ale_find_references)" {:noremap true}) +(vim.keymap.set :n :K "(ale_hover)" {:noremap true}) +(vim.keymap.set :n : "(ale_previous_wrap)" {:silent true}) +(vim.keymap.set :n : "(ale_next_wrap)" {:silent true}) diff --git a/.config/nvim/fnl/ftplugin/fennel.fnl b/.config/nvim/fnl/ftplugin/fennel.fnl new file mode 100644 index 0000000..769db05 --- /dev/null +++ b/.config/nvim/fnl/ftplugin/fennel.fnl @@ -0,0 +1,5 @@ +(set vim.bo.formatprg "fnlfmt /dev/stdin") + +; (let [{: nvim_create_autocmd : nvim_command} vim.api] +; (nvim_create_autocmd :BufWritePre +; {:callback #(nvim_command "normal migggqG`i")})) diff --git a/.config/nvim/fnl/ftplugin/rust.fnl b/.config/nvim/fnl/ftplugin/rust.fnl new file mode 100644 index 0000000..45e071a --- /dev/null +++ b/.config/nvim/fnl/ftplugin/rust.fnl @@ -0,0 +1,2 @@ +(set vim.g.ale_fixers ["rustfmt"]) +(set vim.g.ale_rust_cargo_use_clippy (vim.fn.executable "cargo-clippy")) diff --git a/.config/nvim/fnl/fzf.fnl b/.config/nvim/fnl/fzf.fnl new file mode 100644 index 0000000..469e198 --- /dev/null +++ b/.config/nvim/fnl/fzf.fnl @@ -0,0 +1,25 @@ +;;; fzf + +;; https://github.com/junegunn/fzf/blob/master/README-VIM.md + +(fn init-keymaps [] + (vim.keymap.set :n :b ":Buffers" {:noremap true}) + (vim.keymap.set :n :f ":Files" {:noremap true}) + (vim.keymap.set :n :t ":Tags" {:noremap true})) + +;; https://coreyja.com/vim-spelling-suggestions-fzf/ +(fn init-fzf-spell [] + (let [{: nvim_command : nvim_create_user_command} vim.api + {: expand "fzf#run" fzf-run "fzf#wrap" fzf-wrap : spellsuggest} vim.fn + sink #(nvim_command (.. "normal! \"_ciw" $1)) + fzf-spell #(fzf-run (fzf-wrap {:source (spellsuggest (expand :)) + : sink + :window {:width 0.9 :height 0.6}}))] + (vim.api.nvim_create_user_command :FzfSpell fzf-spell {}) + (vim.keymap.set :n :z= ":FzfSpell" {:noremap true}))) + +(when (vim.fn.isdirectory :/opt/homebrew/opt/fzf/plugin) + (vim.opt.rtp:append :/opt/homebrew/opt/fzf) + (init-keymaps) + (init-fzf-spell)) +