~gagbo/nvim-config

98b4012cbc6ed6126c561169df2093d319114399 — Gerry Agbobada 4 months ago deabf4e
Tweak bindings still
5 files changed, 39 insertions(+), 26 deletions(-)

M fnl/config/bindings.fnl
M fnl/config/plugins/hop.fnl
A fnl/post-plugins/init.fnl
M init.lua
M lazy-lock.json
M fnl/config/bindings.fnl => fnl/config/bindings.fnl +17 -8
@@ 15,12 15,18 @@

(lambda bare []
  "Bare bindings."

  ;; Better diagnostics navigation
  (fn-mapper "n" "[d" (diagnostic-goto false))
  (fn-mapper "n" "]d" (diagnostic-goto true))
  (fn-mapper "n" "[e" (diagnostic-goto false "ERROR"))
  (fn-mapper "n" "]e" (diagnostic-goto true "ERROR"))
  (fn-mapper "n" "[w" (diagnostic-goto false "WARN"))
  (fn-mapper "n" "]w" (diagnostic-goto true "WARN"))

  ;; Undo as U
  (mapper "" "U" "<C-r>")

  ;; Tab to toggle folds (:h zA)
  (mapper "n" "<Tab>" "zA")



@@ 288,15 294,18 @@
(lambda colemak-minimal []
  "Remap keys for colemak mod dh layout."

  (mapper "" "n" "v:count == 0 ? 'gj' : 'j'" { :expr true })
  (mapper "" "N" "J")
  (mapper "" "e" "v:count == 0 ? 'gk' : 'k'" { :expr true })
  (mapper "" "E" "K")
  (noremapper "" "n" "v:count == 0 ? 'gj' : 'j'" { :expr true })
  (noremapper "" "N" "J")
  (noremapper "" "e" "v:count == 0 ? 'gk' : 'k'" { :expr true })
  (noremapper "" "E" "K")

  (noremapper "" "s" "h")
  (noremapper "" "t" "l")

  (mapper "" "j" "n")
  (mapper "" "J" "N")
  (mapper "" "k" "e")
  (mapper "" "K" "E"))
  (noremapper "" "f" "e")
  (noremapper "" "F" "E")
  (noremapper "" "k" "n")
  (noremapper "" "K" "N"))

{: bare
 : leader

M fnl/config/plugins/hop.fnl => fnl/config/plugins/hop.fnl +15 -15
@@ 16,23 16,23 @@
    (mapper "n" "gss" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.BEFORE_CURSOR})<CR>")
    (mapper "o" "gss" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, inclusive_jump = true})<CR>")
;;; f/j to navigate to characters
    (mapper "n" "f" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true})<CR>")
    (mapper "n" "F" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true})<CR>")
    (mapper "o" "f" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true, inclusive_jump = true})<CR>")
    (mapper "o" "F" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true, inclusive_jump = true})<CR>")
    (mapper "" "t" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true})<CR>")
    (mapper "" "T" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true})<CR>")
    ;; (mapper "n" "f" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true})<CR>")
    ;; (mapper "n" "F" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true})<CR>")
    ;; (mapper "o" "f" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true, inclusive_jump = true})<CR>")
    ;; (mapper "o" "F" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true, inclusive_jump = true})<CR>")
    ;; (mapper "" "t" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true})<CR>")
    ;; (mapper "" "T" "<cmd>lua require('hop').hint_char1({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true})<CR>")

    ;; Hop motions
    (leader "n" "t" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.AFTER_CURSOR})<CR>" { :noremap true})
    (leader "v" "t" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.AFTER_CURSOR})<CR>" { :noremap true})
    (leader "o" "t" "<cmd>lua require('hop').hint_lines({direction = require('hop.hint').HintDirection.AFTER_CURSOR, inclusive_jump = true})<CR>" { :noremap true})
    (leader "n" "s" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.BEFORE_CURSOR})<CR>" { :noremap true})
    (leader "v" "s" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.BEFORE_CURSOR})<CR>" { :noremap true})
    (leader "o" "s" "<cmd>lua require('hop').hint_lines({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, inclusive_jump = true})<CR>" { :noremap true})
    (leader "n" "e" "<cmd>lua require('hop').hint_words({ hint_position = require('hop.hint').HintPosition.END})<CR>" { :noremap true})
    (leader "v" "e" "<cmd>lua require('hop').hint_words({ hint_position = require('hop.hint').HintPosition.END})<CR>" { :noremap true})
    (leader "o" "e" "<cmd>lua require('hop').hint_words({ hint_position = require('hop.hint').HintPosition.END, inclusive_jump = true})<CR>" { :noremap true})))
    (leader "n" "n" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.AFTER_CURSOR})<CR>" { :noremap true})
    (leader "v" "n" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.AFTER_CURSOR})<CR>" { :noremap true})
    (leader "o" "n" "<cmd>lua require('hop').hint_lines({direction = require('hop.hint').HintDirection.AFTER_CURSOR, inclusive_jump = true})<CR>" { :noremap true})
    (leader "n" "e" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.BEFORE_CURSOR})<CR>" { :noremap true})
    (leader "v" "e" "<cmd>lua require('hop').hint_lines_skip_whitespace({direction = require('hop.hint').HintDirection.BEFORE_CURSOR})<CR>" { :noremap true})
    (leader "o" "e" "<cmd>lua require('hop').hint_lines({direction = require('hop.hint').HintDirection.BEFORE_CURSOR, inclusive_jump = true})<CR>" { :noremap true})
    (leader "n" "f" "<cmd>lua require('hop').hint_words({ hint_position = require('hop.hint').HintPosition.END})<CR>" { :noremap true})
    (leader "v" "f" "<cmd>lua require('hop').hint_words({ hint_position = require('hop.hint').HintPosition.END})<CR>" { :noremap true})
    (leader "o" "f" "<cmd>lua require('hop').hint_words({ hint_position = require('hop.hint').HintPosition.END, inclusive_jump = true})<CR>" { :noremap true})))

(fn config []
 (let [hop (require :hop)]

A fnl/post-plugins/init.fnl => fnl/post-plugins/init.fnl +1 -0
@@ 0,0 1,1 @@
(vim.notify "Welcome")

M init.lua => init.lua +3 -0
@@ 72,3 72,6 @@ end
require("lazy").setup(
  plugins,
  { install = { missing = true } })

-- Call post plugins code
require("post-plugins")

M lazy-lock.json => lazy-lock.json +3 -3
@@ 14,7 14,7 @@
  "direnv.vim": { "branch": "master", "commit": "165031fa2c8dbb1e78dfd7054fe064ea926384cb" },
  "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" },
  "fennel.vim": { "branch": "master", "commit": "30b9beabad2c4f09b9b284caf5cd5666b6b4dc89" },
  "formatter.nvim": { "branch": "master", "commit": "44c89f09dcc220dc2a9b056e93c3a87c86e79804" },
  "formatter.nvim": { "branch": "master", "commit": "34dcdfa0c75df667743b2a50dd99c84a557376f0" },
  "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
  "gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" },
  "guile.vim": { "branch": "master", "commit": "f76959a9dbdc69cde018901de82ac5a3d443843c" },


@@ 25,7 25,7 @@
  "lush.nvim": { "branch": "main", "commit": "966aad1accd47fa11fbe2539234f81f678fef2de" },
  "mason-lspconfig.nvim": { "branch": "main", "commit": "09be3766669bfbabbe2863c624749d8da392c916" },
  "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
  "neogit": { "branch": "master", "commit": "51a6e6c8952b361300be57b36c8e1b973880cdd7" },
  "neogit": { "branch": "master", "commit": "e2cfea5e48dbbe98277a6c8337b550fa1e5def2a" },
  "nvim-cmp": { "branch": "main", "commit": "d3a3056204e1a9dbb7c7fe36c114dc43b681768c" },
  "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
  "nvim-dap": { "branch": "master", "commit": "b595c820018a15b6d54bf53b5cbeaa6f2d7a27e2" },


@@ 34,7 34,7 @@
  "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
  "nvim-parinfer": { "branch": "master", "commit": "5ca09287ab3f4144f78ff7977fabc27466f71044" },
  "nvim-tree.lua": { "branch": "master", "commit": "78a9ca5ed6557f29cd0ce203df44213e54bfabb9" },
  "nvim-treesitter": { "branch": "master", "commit": "84544f5cd3b7c046ebe0db6763c9ce7f20f4fe23" },
  "nvim-treesitter": { "branch": "master", "commit": "74ea25f95db4dcc61b4311aac02461a075db9c61" },
  "nvim-treesitter-textobjects": { "branch": "master", "commit": "eb208bfdfcf76efea0424747e23e44641e13aaa6" },
  "nvim-web-devicons": { "branch": "master", "commit": "f0267921c845c42685968401bc49aa65e18d3e09" },
  "orgmode": { "branch": "master", "commit": "346b6aaac4678832b80b1794d7873069e7efd423" },