Break things (so I can fix them later)
This commit is contained in:
parent
3f81479bc6
commit
3317339d51
25
init.fnl
25
init.fnl
@ -10,6 +10,27 @@
|
||||
(when desc
|
||||
(tset opts :desc desc))
|
||||
`(vim.keymap.set ,mode ,key ,cmd ,opts)))
|
||||
;; Better autocommands
|
||||
(macro hook! [hooks ?patterns callback]
|
||||
(let [hook_table (if (= (type hooks) :table)
|
||||
hooks
|
||||
[ hooks ])
|
||||
pattern_table (if (not ?patterns)
|
||||
[]
|
||||
(= (type ?patterns) :table)
|
||||
?patterns
|
||||
[ ?patterns ])]
|
||||
(var group "config-hook")
|
||||
(each [_ hook (ipairs hook_table)]
|
||||
(set group (.. group "-" hook)))
|
||||
(each [_ pattern (ipairs pattern_table)]
|
||||
(set group (.. group "-" patterns)))
|
||||
`(vim.api.nvim_create_autocmd ,hook_table
|
||||
{ :group
|
||||
(vim.api.nvim_create_augroup ,group
|
||||
{ :clear true })
|
||||
:pattern ,pattern_table
|
||||
:callback ,callback })))
|
||||
|
||||
;; Make space leader
|
||||
(set vim.g.mapleader " ")
|
||||
@ -459,7 +480,9 @@
|
||||
:enable false }}})))
|
||||
(use! :neovim/nvim-lspconfig
|
||||
:after :cmp-nvim-lsp
|
||||
:config lsp_config_callback))
|
||||
:config lsp_config_callback)
|
||||
(use! :mfussenegger/nvim-jdtls
|
||||
:after :nvim-lspconfig))
|
||||
|
||||
(vim.cmd.packadd "packer.nvim")
|
||||
(let [packer (require :packer)]
|
||||
|
Reference in New Issue
Block a user