include all fennel neovim configuration

pull/2/head
Alpha Chen 2 years ago
parent 07aedad8cb
commit c0d7b2ca23

@ -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 "<Plug>(ale_go_to_definition)" {:noremap true})
(vim.keymap.set :n :gr "<Plug>(ale_find_references)" {:noremap true})
(vim.keymap.set :n :K "<Plug>(ale_hover)" {:noremap true})
(vim.keymap.set :n :<C-k> "<Plug>(ale_previous_wrap)" {:silent true})
(vim.keymap.set :n :<C-j> "<Plug>(ale_next_wrap)" {:silent true})

@ -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")}))

@ -0,0 +1,2 @@
(set vim.g.ale_fixers ["rustfmt"])
(set vim.g.ale_rust_cargo_use_clippy (vim.fn.executable "cargo-clippy"))

@ -0,0 +1,25 @@
;;; fzf
;; https://github.com/junegunn/fzf/blob/master/README-VIM.md
(fn init-keymaps []
(vim.keymap.set :n :<leader>b ":Buffers<cr>" {:noremap true})
(vim.keymap.set :n :<leader>f ":Files<cr>" {:noremap true})
(vim.keymap.set :n :<leader>t ":Tags<cr>" {: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 :<cword>))
: sink
:window {:width 0.9 :height 0.6}}))]
(vim.api.nvim_create_user_command :FzfSpell fzf-spell {})
(vim.keymap.set :n :z= ":FzfSpell<cr>" {:noremap true})))
(when (vim.fn.isdirectory :/opt/homebrew/opt/fzf/plugin)
(vim.opt.rtp:append :/opt/homebrew/opt/fzf)
(init-keymaps)
(init-fzf-spell))
Loading…
Cancel
Save