feat: neotab.nvim

This commit is contained in:
punkfairie 2024-12-08 18:10:07 -08:00
parent b4b493f656
commit 68f0530548
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
5 changed files with 64 additions and 13 deletions

View file

@ -280,6 +280,22 @@
"type": "github" "type": "github"
} }
}, },
"neotab-nvim": {
"flake": false,
"locked": {
"lastModified": 1733176083,
"narHash": "sha256-5IJQwZxDGDMM6KBWKU/EZwa5wciHeTXOZgHPCRmlxJk=",
"owner": "kawre",
"repo": "neotab.nvim",
"rev": "f6ed1ef49f32586f5db95edae5d6f264c8180d85",
"type": "github"
},
"original": {
"owner": "kawre",
"repo": "neotab.nvim",
"type": "github"
}
},
"neovim-nightly": { "neovim-nightly": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@ -385,6 +401,7 @@
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"gen-luarc": "gen-luarc", "gen-luarc": "gen-luarc",
"neotab-nvim": "neotab-nvim",
"neovim-nightly": "neovim-nightly", "neovim-nightly": "neovim-nightly",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
} }

View file

@ -11,11 +11,10 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Add bleeding-edge plugins here. neotab-nvim = {
# wf-nvim = { url = "github:kawre/neotab.nvim";
# url = "github:Cassin01/wf.nvim"; flake = false;
# flake = false; };
# };
}; };
outputs = inputs @ { outputs = inputs @ {

View file

@ -4,11 +4,11 @@ with final.pkgs.lib; let
pkgs = final; pkgs = final;
# Use this to create a plugin from a flake input # Use this to create a plugin from a flake input
# mkNvimPlugin = src: pname: mkNvimPlugin = src: pname:
# pkgs.vimUtils.buildVimPlugin { pkgs.vimUtils.buildVimPlugin {
# inherit pname src; inherit pname src;
# version = src.lastModifiedDate; version = src.lastModifiedDate;
# }; };
# Make sure we use the pinned nixpkgs instance for wrapNeovimUnstable, # Make sure we use the pinned nixpkgs instance for wrapNeovimUnstable,
# otherwise it could have an incompatible signature when applying this overlay. # otherwise it could have an incompatible signature when applying this overlay.
@ -26,9 +26,6 @@ with final.pkgs.lib; let
# ... # ...
# } # }
all-plugins = with pkgs.vimPlugins; [ all-plugins = with pkgs.vimPlugins; [
# bleeding-edge plugins from flake inputs
# (mkNvimPlugin inputs.wf-nvim "wf.nvim") # (example) keymap hints
# Base # Base
lz-n lz-n
snacks-nvim snacks-nvim
@ -58,6 +55,7 @@ with final.pkgs.lib; let
# Coding # Coding
lexima-vim lexima-vim
(mkNvimPlugin inputs.neotab-nvim "neotab.nvim")
# Treesitter # Treesitter
nvim-treesitter-textobjects nvim-treesitter-textobjects

View file

@ -2,4 +2,5 @@ local req = MarleyVim.local_require('plugins.coding')
return { return {
req('lexima-vim'), req('lexima-vim'),
req('neotab-nvim'),
} }

View file

@ -0,0 +1,36 @@
return {
'neotab.nvim',
event = 'InsertEnter',
after = function()
require('neotab').setup({
behavior = 'closing',
smart_punctuators = {
enabled = true,
semicolon = {
enabled = true,
ft = { 'javascript', 'typescript', 'php', 'nix' },
},
escape = {
enabled = true,
triggers = {
[','] = {
pairs = {
{ open = "'", close = "'" },
{ open = '"', close = '"' },
},
format = '%s ', -- ", "
},
['='] = {
pairs = {
{ open = '(', close = ')' },
},
ft = { 'javascript', 'typescript' },
format = ' %s> ', -- ` => `
cond = '^$', -- match only pairs with empty content
},
},
},
},
})
end,
}