summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorIhsan Tonuzi <115842560+iton0@users.noreply.github.com>2024-08-22 21:00:39 -0400
committerGitHub <noreply@github.com>2024-08-22 21:00:39 -0400
commitac78e7d9e77048fa7d5b0711f85aab93508e71a7 (patch)
treea2af5d4fe2dfd98c53c8512a6b0e373289ecf0a2 /init.lua
parentce0c7340fff68fb45d817478a8c0facb24425149 (diff)
refactor: update treesitter and which-key config (#1068)
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua60
1 files changed, 46 insertions, 14 deletions
diff --git a/init.lua b/init.lua
index 314a05b..41b5a97 100644
--- a/init.lua
+++ b/init.lua
@@ -275,7 +275,44 @@ require('lazy').setup({
'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
config = function() -- This is the function that runs, AFTER loading
- require('which-key').setup()
+ require('which-key').setup {
+ icons = {
+ -- set icon mappings to true if you have a Nerd Font
+ mappings = vim.g.have_nerd_font,
+ -- If you are using a Nerd Font: set icons.keys to an empty table which will use the
+ -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table
+ keys = vim.g.have_nerd_font and {} or {
+ Up = '<Up> ',
+ Down = '<Down> ',
+ Left = '<Left> ',
+ Right = '<Right> ',
+ C = '<C-…> ',
+ M = '<M-…> ',
+ D = '<D-…> ',
+ S = '<S-…> ',
+ CR = '<CR> ',
+ Esc = '<Esc> ',
+ ScrollWheelDown = '<ScrollWheelDown> ',
+ ScrollWheelUp = '<ScrollWheelUp> ',
+ NL = '<NL> ',
+ BS = '<BS> ',
+ Space = '<Space> ',
+ Tab = '<Tab> ',
+ F1 = '<F1>',
+ F2 = '<F2>',
+ F3 = '<F3>',
+ F4 = '<F4>',
+ F5 = '<F5>',
+ F6 = '<F6>',
+ F7 = '<F7>',
+ F8 = '<F8>',
+ F9 = '<F9>',
+ F10 = '<F10>',
+ F11 = '<F11>',
+ F12 = '<F12>',
+ },
+ },
+ }
-- Document existing key chains
require('which-key').add {
@@ -843,6 +880,8 @@ require('lazy').setup({
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
+ main = 'nvim-treesitter.configs', -- Sets main module to use for opts
+ -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
@@ -856,19 +895,12 @@ require('lazy').setup({
},
indent = { enable = true, disable = { 'ruby' } },
},
- config = function(_, opts)
- -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
-
- ---@diagnostic disable-next-line: missing-fields
- require('nvim-treesitter.configs').setup(opts)
-
- -- There are additional nvim-treesitter modules that you can use to interact
- -- with nvim-treesitter. You should go explore a few and see what interests you:
- --
- -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
- -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
- -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
- end,
+ -- There are additional nvim-treesitter modules that you can use to interact
+ -- with nvim-treesitter. You should go explore a few and see what interests you:
+ --
+ -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
+ -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
+ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
},
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the