plugin.fnl 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. ;;; plugin.fnl - plugin configurations
  2. (import-macros {: bind! : hook!
  3. : use! : setup!
  4. : module-call!
  5. : module-fn! } :macros)
  6. (fn [use]
  7. ;; Packer
  8. (use! :wbthomason/packer.nvim)
  9. ;; tangerine.nvim (auto fennel compile)
  10. (use! :udayvir-singh/tangerine.nvim)
  11. ;; hy syntax
  12. (use! :hylang/vim-hy)
  13. ;; rainbow delimiters
  14. (use! :HiPhish/rainbow-delimiters.nvim)
  15. ;; Treesitter
  16. (use! :nvim-treesitter/nvim-treesitter
  17. :config
  18. (setup! :nvim-treesitter.configs
  19. ;:ensure_installed :all
  20. ;:sync_install false
  21. ;:auto_install true
  22. :highlight { :enable true
  23. :additional_vim_regex_highlighting false }
  24. :indent { :enable true }))
  25. ;; nightfox.nvim (colorscheme)
  26. (use! :EdenEast/nightfox.nvim
  27. :after :nvim-treesitter
  28. :config
  29. (vim.cmd.colorscheme :carbonfox))
  30. ;; Arm asm syntax
  31. (use! :https://git.zander.im/Zander671/arm-syntax-vim.git)
  32. ;; Devicons
  33. (use! :kyazdani42/nvim-web-devicons)
  34. ;; lualine.nvim
  35. (use! :nvim-lualine/lualine.nvim
  36. :after [ :nightfox.nvim :nvim-web-devicons ]
  37. :config
  38. (setup! :lualine
  39. :options { :section_separators ""
  40. :component_separators "│" }))
  41. ;; bufferline.nvim
  42. (use! :akinsho/bufferline.nvim
  43. :after [ :nvim-web-devicons :nightfox.nvim ]
  44. :config
  45. (setup! :bufferline
  46. :options {
  47. :always_show_bufferline false
  48. :mode :tabs
  49. :numbers :buffer-id
  50. :show_buffer_close_icons false
  51. :show_close_icon false }))
  52. (use! :nvim-lua/plenary.nvim
  53. :opt true
  54. :module :plenary)
  55. ;; telescope (a fuzzy finder)
  56. (use! :nvim-telescope/telescope.nvim
  57. :cmd :Telescope
  58. :module :telescope
  59. :requires [ { 1 :nvim-telescope/telescope-ui-select.nvim
  60. :opt true }
  61. { 1 :nvim-telescope/telescope-fzf-native.nvim
  62. :opt true
  63. :run :make }]
  64. :setup
  65. (module-call! :plugin.telescope :setup)
  66. :config
  67. (module-call! :plugin.telescope :config))
  68. ;; Trouble
  69. (use! :folke/trouble.nvim
  70. :cmd [ :Trouble
  71. :TroubleToggle
  72. :TroubleClose
  73. :TroubleRefresh ]
  74. :module :trouble
  75. :config
  76. (setup! :trouble))
  77. ;; Nvim surround
  78. (use! :kylechui/nvim-surround
  79. :config
  80. (setup! :nvim-surround))
  81. ;; Leap
  82. (use! :ggandor/leap.nvim
  83. :after :nvim-treesitter
  84. :config
  85. ((. (require :leap) :add_default_mappings))
  86. (bind! :o :z "<plug>(leap-forward-to)")
  87. (bind! :o :Z "<plug>(leap-backward-to)")
  88. (vim.api.nvim_set_hl 0 :LeapBackdrop { :link :Comment }))
  89. ;; Leap spooky (remote operations)
  90. (use! :ggandor/leap-spooky.nvim
  91. :after :leap.nvim
  92. :config
  93. (setup! :leap-spooky))
  94. ;; Flit (leap for 'till' and 'forward' motions)
  95. (use! :ggandor/flit.nvim
  96. :after :leap.nvim
  97. :config
  98. (setup! :flit))
  99. ;; Comment.nvim
  100. (use! :numToStr/Comment.nvim
  101. :keys [ :gc :gb ]
  102. :config
  103. (setup! :Comment))
  104. ;; illuminate (same symbol highlight)
  105. (use! :RRethy/vim-illuminate
  106. :config
  107. (module-call! :illuminate
  108. :configure { :providers [
  109. "lsp"
  110. "treesitter"
  111. "ragex" ]
  112. :filetypes_denylist [
  113. :Trouble
  114. :markdown
  115. :text
  116. :gitconfig
  117. :gitignore ]
  118. :delay 0 })
  119. (hook! :FileType :lua #(vim.api.nvim_set_hl 0
  120. :IlluminatedWordText
  121. {})))
  122. ;; Snippy
  123. (use! :dcampos/nvim-snippy
  124. :config
  125. (let [map (require :snippy.mapping)]
  126. (bind! [ :i :s ] :<tab> ((. map :next) :<tab>))
  127. (bind! [ :i :s ] :<s-tab> (map.previous :<tab>))))
  128. ;; nvim-cmp (autocomplete)
  129. (use! :hrsh7th/nvim-cmp
  130. :requires [ :hrsh7th/cmp-buffer
  131. :hrsh7th/cmp-path
  132. :hrsh7th/cmp-cmdline
  133. :hrsh7th/cmp-nvim-lsp
  134. { 1 :ray-x/cmp-treesitter
  135. :after :nvim-cmp }
  136. :dcampos/cmp-snippy ]
  137. :config
  138. (module-call! :plugin.cmp :configure))
  139. ;; does what the name says, lets you pick icons
  140. (use! :ziontee113/icon-picker.nvim
  141. :cmd [ :IconPickerNormal :IconPickerYank ]
  142. :setup
  143. (bind! :n :<leader>ci "<cmd>IconPickerNormal<cr>")
  144. (bind! :n :<leader>cy "<cmd>IconPickerYank<cr>")
  145. :config
  146. (vim.cmd "PackerLoad telescope.nvim")
  147. (setup! :icon-picker
  148. :disable_legacy_commands true))
  149. (use! :jbyuki/nabla.nvim
  150. :module :nabla
  151. :setup
  152. (bind! :n :<leader>p #(module-call! :nabla :popup)))
  153. ; oil (file manager)
  154. (use! :stevearc/oil.nvim
  155. :config
  156. (setup! :oil
  157. :columns [ :icon :permissions :size: :mtime ]))
  158. ;; guess style from buffer
  159. (use! :NMAC427/guess-indent.nvim
  160. :config
  161. (setup! :guess-indent :auto_cmd true))
  162. ;(use! :edluffy/hologram.nvim
  163. ; :config
  164. ; (setup! :hologram
  165. ; :auto_display true))
  166. ;; lspconfig
  167. (use! :neovim/nvim-lspconfig
  168. :after :cmp-nvim-lsp
  169. :config
  170. (module-call! :plugin.lsp :configure))
  171. ;; null-ls.nvim
  172. (use! :nvimtools/none-ls.nvim
  173. :after :nvim-lspconfig
  174. :config
  175. (module-call! :plugin.lsp :setup-null-ls))
  176. ;; nvim-jdtls
  177. (use! :mfussenegger/nvim-jdtls
  178. :config
  179. (module-call! :plugin.jdtls :configure))
  180. ;; formatter.nvim
  181. ;(use! :mhartington/formatter.nvim
  182. ; :cmd [ :Format :FormatWrite ]
  183. ; :setup
  184. ; (bind! :n :<leader>o "<cmd>Format<cr>")
  185. ; (bind! :v :<leader>o ":Format<cr>")
  186. ; :config
  187. ; (setup! :formatter
  188. ; :logging true
  189. ; :log_level _G.vim.log.levels.WA;RN
  190. ; :filetype {
  191. ; :c [ (module-fn! :formatter.filetypes.c :astyle) ]
  192. ; :cpp [ (module-fn! :formatter.filetypes.cpp :astyle) ]
  193. ; :cmake [
  194. ; (module-fn! :formatter.filetypes.cmake :cmakeformat) ]
  195. ; :java [ (fn [] {:exe :astyle
  196. ; :stdin true
  197. ; :args [ :--mode=java ]}) ]
  198. ; :sh [ (module-fn! :formatter.filetypes.sh :shfmt) ]
  199. ; :rust [ (module-fn! :formatter.filetypes.rust :rustfmt) ]
  200. ; :tex [ (module-fn! :formatter.filetypes.latex :latexindent) ]
  201. ; :python [ (module-fn! :formatter.filetypes.python :yapf) ]
  202. ; :json [ (module-fn! :formatter.filetypes.json :prettier) ]
  203. ; :html [ (module-fn! :formatter.filetypes.html :prettier) ]
  204. ; :css [ (module-fn! :formatter.filetypes.css :prettier) ]
  205. ; :javascript [ (module-fn! :formatter.filetypes.javascript :prettier) ]
  206. ; :markdown [
  207. ; (module-fn! :formatter.filetypes.markdown :prettier ) ]
  208. ; :fennel [ (fn [] {:exe :fnlfmt
  209. ; :stdin true
  210. ; :args [ "-" ]})]}))
  211. ;; Sync all packages on first launch
  212. (if _G.first_launch
  213. (module-call! :packer :sync)))