]> localhost Git - nvim.git/commitdiff
feat: keymaps + nordic theme
authorJansen <[email protected]>
Fri, 27 Sep 2024 01:24:50 +0000 (21:24 -0400)
committerJansen <[email protected]>
Fri, 27 Sep 2024 01:24:50 +0000 (21:24 -0400)
init.lua
lazy-lock.json

index 282a0c23118d330525920ee01caea2e40ab09f42..c9e902383bf15a7e1cbbbbdc47647f2d20140169 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -35,30 +35,14 @@ require("lazy").setup({
     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 = {
@@ -72,4 +56,78 @@ require("lazy").setup({
       })
     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)
index 66d501e3bdccdf0ce117a6b826c3a2a12e8d067c..e9760a6f076cfe741ea0c40d3a015efb4786183f 100644 (file)
@@ -1,4 +1,5 @@
 {
   "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
+  "nordic.nvim": { "branch": "main", "commit": "1ee4044077059b34eacd18d93613495a602c131f" },
   "nvim-treesitter": { "branch": "master", "commit": "0c8a582e474e248f2a4406188e0c653f92a064cf" }
 }