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
|
(usercmd :FormatEnableBuffer mod.enable-for-buffer
|
||||||
{:desc "Enable Formatting for the current buffer"})
|
{:desc "Enable Formatting for the current buffer"})
|
||||||
(aucmd :BufWritePre
|
(aucmd :BufWritePre
|
||||||
{:callback mod.maybe-format-buffer
|
{:callback #(mod.maybe-format-buffer $1.buf)
|
||||||
:group augroup
|
:group augroup
|
||||||
:desc "Run Formatter before saving"})))
|
:desc "Run Formatter before saving"})))
|
||||||
|
|
||||||
|
@ -35,9 +35,9 @@
|
||||||
(if (= b.nifoc_formatter_disabled 1) false
|
(if (= b.nifoc_formatter_disabled 1) false
|
||||||
(or (has-formatter-config? ft) (format-with-lsp? ft)))))
|
(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]
|
(let [ft vim.bo.filetype]
|
||||||
(if (= b.nifoc_formatter_disabled 1) nil
|
(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)
|
mod)
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
(keymap.set :n :<leader>dtp :<cmd>TSPlaygroundToggle<CR>
|
(keymap.set :n :<leader>dtp :<cmd>TSPlaygroundToggle<CR>
|
||||||
{:desc "Toggle Treetsitter Playground"})
|
{:desc "Toggle Treetsitter Playground"})
|
||||||
;; Other Mappings
|
;; 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-Left> :b)
|
||||||
(keymap.set :n :<A-Right> :w)
|
(keymap.set :n :<A-Right> :w)
|
||||||
(keymap.set :n :<S-Left> "^")
|
(keymap.set :n :<S-Left> "^")
|
||||||
|
|
|
@ -25,7 +25,10 @@
|
||||||
((. (require :mini.jump2d) :setup) {:hooks {:before_start (fn []
|
((. (require :mini.jump2d) :setup) {:hooks {:before_start (fn []
|
||||||
(vim.cmd :nohlsearch))}})
|
(vim.cmd :nohlsearch))}})
|
||||||
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md
|
;; 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
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-surround.md
|
||||||
((. (require :mini.surround) :setup) {})
|
((. (require :mini.surround) :setup) {})
|
||||||
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pairs.md
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pairs.md
|
||||||
|
|
Loading…
Reference in a new issue