config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
- "asm",
- "bash",
- "c",
- "comment",
- "cpp",
- "css",
- "csv",
- "gitignore",
- "glsl",
- "go",
- "html",
- "ini",
- "java",
- "javascript",
- "json",
- "lua",
- "make",
- "python",
- "rust",
- "tmux",
- "toml",
- "tsx",
- "typescript",
- "yaml",
+ "asm", "bash", "c",
+ "comment", "cpp", "css",
+ "csv", "gitignore", "glsl",
+ "go", "html", "ini",
+ "java", "javascript", "json",
+ "lua", "make", "python",
+ "rust", "tmux", "toml",
+ "tsx", "typescript", "yaml",
"zig",
},
highlight = {
})
end
},
+ {
+ 'AlexvZyl/nordic.nvim',
+ lazy = false,
+ priority = 1000,
+ config = function()
+ local nordic = require('nordic')
+ nordic.setup({ bold_keywords = true })
+ nordic.load()
+ end
+ }
})
+
+-- KeyBindings =================================================================
+vim.g.mapleader = vim.keycode' '
+
+-- Utils
+vim.keymap.set('n', '<leader>H', function() vim.cmd [[nohl]] end)
+
+-- Buffers/Windows (inplace)
+vim.keymap.set('n', '<leader>e', function() vim.cmd [[Explore]] end)
+vim.keymap.set('n', '<leader>q', function()
+ local win_count = #vim.api.nvim_list_wins()
+ vim.cmd [[confirm qa]]
+end)
+vim.keymap.set('n', '<leader>c', function()
+ vim.cmd [[confirm quit]]
+end)
+
+-- Buffers/Windows (horizontal)
+vim.keymap.set('n', '<leader>se', function() vim.cmd [[Hexplore]] end)
+vim.keymap.set('n', '<leader>ss', function()
+ vim.cmd [[split]]
+ vim.cmd [[wincmd j]]
+end)
+
+-- Buffers/Windows (vertical)
+vim.keymap.set('n', '<leader>ve', function() vim.cmd [[Vexplore!]] end)
+vim.keymap.set('n', '<leader>vs', function()
+ vim.cmd [[vsplit]]
+ vim.cmd [[wincmd l]]
+end)
+
+-- Tabs
+tab_next = true
+function open_texplore()
+ tab_next = true
+ vim.cmd [[Texplore]]
+end
+function next_tab()
+ tab_next = true
+ vim.cmd [[tabn]]
+end
+function prev_tab()
+ tab_next = false
+ vim.cmd [[tabp]]
+end
+function last_tab()
+ if tab_next then
+ prev_tab()
+ else
+ next_tab()
+ end
+end
+function close_tab()
+ local total_tabs = #vim.api.nvim_list_tabpages()
+ if total_tabs > 1 then
+ tab_next = true
+ vim.cmd [[tabc]]
+ end
+end
+vim.keymap.set('n', '<leader>te', open_texplore)
+vim.keymap.set('n', '<leader>tn', next_tab)
+vim.keymap.set('n', '<leader>tb', prev_tab)
+vim.keymap.set('n', '<leader>tt', last_tab)
+vim.keymap.set('n', '<leader>tc', close_tab)