nvim: Update keymaps
This commit is contained in:
parent
1da7fbc650
commit
46145fc2fd
3 changed files with 8 additions and 5 deletions
|
@ -12,7 +12,7 @@
|
|||
(usercmd :FormatEnableBuffer mod.enable-for-buffer
|
||||
{:desc "Enable Formatting for the current buffer"})
|
||||
(aucmd :BufWritePre
|
||||
{:callback mod.maybe-format-buffer
|
||||
{:callback #(mod.maybe-format-buffer $1.buf)
|
||||
:group augroup
|
||||
:desc "Run Formatter before saving"})))
|
||||
|
||||
|
@ -35,9 +35,9 @@
|
|||
(if (= b.nifoc_formatter_disabled 1) false
|
||||
(or (has-formatter-config? ft) (format-with-lsp? ft)))))
|
||||
|
||||
(fn mod.maybe-format-buffer []
|
||||
(fn mod.maybe-format-buffer [bufnr]
|
||||
(let [ft vim.bo.filetype]
|
||||
(if (= b.nifoc_formatter_disabled 1) nil
|
||||
(conform.format {:lsp_fallback (format-with-lsp? ft)}))))
|
||||
(conform.format {: bufnr :lsp_fallback (format-with-lsp? ft)}))))
|
||||
|
||||
mod)
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
(keymap.set :n :<leader>dtp :<cmd>TSPlaygroundToggle<CR>
|
||||
{:desc "Toggle Treetsitter Playground"})
|
||||
;; Other Mappings
|
||||
(keymap.set :n :F formatting.maybe-format-buffer {:desc "Format Buffer"})
|
||||
(keymap.set :n :F #(formatting.maybe-format-buffer 0) {:desc "Format Buffer"})
|
||||
(keymap.set :n :<A-Left> :b)
|
||||
(keymap.set :n :<A-Right> :w)
|
||||
(keymap.set :n :<S-Left> "^")
|
||||
|
|
|
@ -25,7 +25,10 @@
|
|||
((. (require :mini.jump2d) :setup) {:hooks {:before_start (fn []
|
||||
(vim.cmd :nohlsearch))}})
|
||||
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md
|
||||
((. (require :mini.move) :setup) {})
|
||||
((. (require :mini.move) :setup) {:mappings {:down :<A-Down>
|
||||
:up :<A-Up>
|
||||
:line_down :<A-Down>
|
||||
:line_up :<A-Up>}})
|
||||
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-surround.md
|
||||
((. (require :mini.surround) :setup) {})
|
||||
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pairs.md
|
||||
|
|
Loading…
Reference in a new issue