]> localhost Git - nvim.git/commitdiff
feat: neovide setup + plugins + keybinds
authorJansen <[email protected]>
Wed, 2 Oct 2024 00:52:41 +0000 (20:52 -0400)
committerJansen <[email protected]>
Wed, 2 Oct 2024 00:52:41 +0000 (20:52 -0400)
init.lua
lazy-lock.json

index c9e902383bf15a7e1cbbbbdc47647f2d20140169..ad76c1c5a2363335bfb9b7a3aff10ffd57ffaff8 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -15,6 +15,14 @@ vim.opt.foldenable = true
 
 vim.opt.cursorline = true
 
+-- Neovide =====================================================================
+if vim.g.neovide then
+  vim.g.neovide_hide_mouse_when_typing = true
+
+  vim.o.guifont = "Iosevka NF:h12"
+  vim.opt.linespace = 0
+end
+
 -- Lazy NVIM ===================================================================
 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
 if not (vim.uv or vim.loop).fs_stat(lazypath) then
@@ -30,6 +38,17 @@ end
 vim.opt.rtp:prepend(lazypath)
 
 require("lazy").setup({
+  { 'MeanderingProgrammer/render-markdown.nvim', opts = {} },
+  { "ibhagwan/fzf-lua"  },
+  {
+    "NeogitOrg/neogit",
+    dependencies = {
+      "nvim-lua/plenary.nvim",
+      "sindrets/diffview.nvim",
+      "ibhagwan/fzf-lua",
+    },
+    config = true
+  },
   { 
     "nvim-treesitter/nvim-treesitter",
     config = function()
@@ -65,27 +84,39 @@ require("lazy").setup({
       nordic.setup({ bold_keywords = true })
       nordic.load()
     end
-  }
+  },
 })
 
+-- CustomCommands ==============================================================
+function edit_config()
+  vim.cmd [[cd ~/.config/nvim]]
+  vim.cmd [[e ~/.config/nvim/init.lua]]
+end
+vim.api.nvim_create_user_command('Econfig', edit_config, {})
+
 -- KeyBindings =================================================================
 vim.g.mapleader = vim.keycode' '
 
 -- Utils
 vim.keymap.set('n', '<leader>H', function() vim.cmd [[nohl]] end)
 
+-- Find (fzf)
+vim.keymap.set('n', '<leader>ff',  function() vim.cmd [[FzfLua files]] end)
+vim.keymap.set('n', '<leader>ft',  function() 
+  vim.cmd [[FzfLua grep_visual]] 
+end)
+vim.keymap.set('n', '<leader>fm',  function() vim.cmd [[FzfLua marks]] end)
+
 -- Buffers/Windows (inplace)
-vim.keymap.set('n', '<leader>e',  function() vim.cmd [[Explore]]   end)
+vim.keymap.set('n', '<leader>e',  function() vim.cmd [[Explore]] end)
+vim.keymap.set('n', '<leader>c',  function() vim.cmd [[confirm quit]] 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>se', function() vim.cmd [[Hexplore]] end)
 vim.keymap.set('n', '<leader>ss', function() 
   vim.cmd [[split]]  
   vim.cmd [[wincmd j]]  
@@ -104,6 +135,12 @@ function open_texplore()
   tab_next = true
   vim.cmd [[Texplore]]
 end
+function open_tterm()
+  tab_next = true
+  vim.cmd [[tabnew]]
+  vim.cmd [[term]]
+  vim.cmd [[startinsert]]
+end
 function next_tab()
   tab_next = true
   vim.cmd [[tabn]]
@@ -112,13 +149,9 @@ 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 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
@@ -128,6 +161,7 @@ function close_tab()
 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>tp', prev_tab)
 vim.keymap.set('n', '<leader>tt', last_tab)
+vim.keymap.set('n', '<leader>tT', open_tterm)
 vim.keymap.set('n', '<leader>tc', close_tab)
index e9760a6f076cfe741ea0c40d3a015efb4786183f..8aa5f71771f05852c9b34b069314ac5030a37a93 100644 (file)
@@ -1,5 +1,10 @@
 {
-  "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
+  "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
+  "fzf-lua": { "branch": "main", "commit": "a1f834b37506ca77c47fa99cd3f5e9ed3f4102d2" },
+  "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" },
+  "neogit": { "branch": "master", "commit": "950d6f91529573dfd89b32c5fc55c52f72dee603" },
   "nordic.nvim": { "branch": "main", "commit": "1ee4044077059b34eacd18d93613495a602c131f" },
-  "nvim-treesitter": { "branch": "master", "commit": "0c8a582e474e248f2a4406188e0c653f92a064cf" }
+  "nvim-treesitter": { "branch": "master", "commit": "da61d31a3d51f38a78a739392aabf79e7b2f523f" },
+  "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
+  "render-markdown.nvim": { "branch": "main", "commit": "e91b042b3865d2d040a0e21e0a3b13fb57f24094" }
 }