mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 01:17:42 -04:00
Neovim setup
Can it be this easy to make nvim stuff just work? Do I really just need to pull the files in with Home Manager? It seems so, so long as nvim knows about gcc :) There is also a related side of tmux here because it all ties together.
This commit is contained in:
parent
5b7bb14cd6
commit
dfc94f8c69
27 changed files with 369 additions and 3 deletions
|
|
@ -1,20 +1,29 @@
|
|||
{ pkgs, genebean-omp-themes, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
cargo
|
||||
colordiff
|
||||
dogdns
|
||||
dos2unix
|
||||
du-dust
|
||||
fd
|
||||
git-filter-repo
|
||||
gotop
|
||||
htop
|
||||
hub
|
||||
jq
|
||||
lazygit
|
||||
lua-language-server
|
||||
minicom
|
||||
mtr
|
||||
nil
|
||||
nix-zsh-completions
|
||||
nodejs
|
||||
nodePackages.npm
|
||||
nurl
|
||||
powershell
|
||||
puppet-lint
|
||||
rename
|
||||
ruby
|
||||
subversion
|
||||
tree
|
||||
trippy
|
||||
|
|
@ -78,15 +87,43 @@
|
|||
};
|
||||
}; # end git
|
||||
jq.enable = true;
|
||||
neovim.enable = true;
|
||||
neovim = {
|
||||
enable = true;
|
||||
defaultEditor = false;
|
||||
extraLuaConfig = ''
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("config.keymaps")
|
||||
require("lazy").setup("plugins")
|
||||
'';
|
||||
extraPackages = [ pkgs.gcc ]; # needed so treesitter can do compiling
|
||||
plugins = [ pkgs.vimPlugins.lazy-nvim ]; # let lazy.nvim manage every other plugin
|
||||
};
|
||||
oh-my-posh = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = builtins.fromJSON (builtins.unsafeDiscardStringContext (builtins.readFile (genebean-omp-themes + "/beanbag.omp.json")));
|
||||
};
|
||||
ripgrep.enable = true;
|
||||
tmux = {
|
||||
enable = true;
|
||||
historyLimit = 100000;
|
||||
tmuxinator.enable = true;
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
vim-tmux-navigator
|
||||
{
|
||||
plugin = dracula;
|
||||
extraConfig = ''
|
||||
set -g @dracula-show-battery false
|
||||
set -g @dracula-show-powerline true
|
||||
set -g @dracula-refresh-rate 10
|
||||
'';
|
||||
}
|
||||
];
|
||||
extraConfig = ''
|
||||
set -g status-position top
|
||||
'';
|
||||
};
|
||||
vim = {
|
||||
enable = true;
|
||||
|
|
@ -107,6 +144,7 @@
|
|||
vim-ruby
|
||||
vim-snipmate
|
||||
vim-snippets
|
||||
vim-tmux-navigator
|
||||
vim-yaml
|
||||
];
|
||||
settings = {
|
||||
|
|
@ -213,6 +251,10 @@
|
|||
}; # end programs
|
||||
|
||||
home.file = {
|
||||
".config/nvim/lua" = {
|
||||
source = ../files/nvim/lua;
|
||||
recursive = true;
|
||||
};
|
||||
".config/powershell/Microsoft.PowerShell_profile.ps1".source = ../files/Microsoft.PowerShell_profile.ps1;
|
||||
".config/powershell/Microsoft.VSCode_profile.ps1".source = ../files/Microsoft.PowerShell_profile.ps1;
|
||||
};
|
||||
|
|
|
|||
11
modules/home-manager/files/nvim/lua/config/keymaps.lua
Normal file
11
modules/home-manager/files/nvim/lua/config/keymaps.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- use spaces for tabs and whatnot
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.shiftround = true
|
||||
|
||||
vim.keymap.set('n', '<leader>h', ':nohlsearch<CR>')
|
||||
14
modules/home-manager/files/nvim/lua/disabled/barbar.lua
Normal file
14
modules/home-manager/files/nvim/lua/disabled/barbar.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {'romgrk/barbar.nvim',
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||
},
|
||||
init = function() vim.g.barbar_auto_setup = false end,
|
||||
opts = {
|
||||
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||
-- animation = true,
|
||||
-- insert_at_start = true,
|
||||
-- …etc.
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
return{
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
event = "BufReadPre",
|
||||
config = true
|
||||
}
|
||||
11
modules/home-manager/files/nvim/lua/disabled/nvim-tree.lua
Normal file
11
modules/home-manager/files/nvim/lua/disabled/nvim-tree.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
config = function ()
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
require('nvim-tree').setup()
|
||||
|
||||
vim.keymap.set('n', '<c-n>', ':NvimTreeFindFileToggle<CR>')
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
flavour = "frappe", -- latte, frappe, macchiato, mocha
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000 ,
|
||||
config = function ()
|
||||
require("gruvbox").setup()
|
||||
|
||||
vim.o.background = "dark"
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme "gruvbox"
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"rebelot/kanagawa.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme "kanagawa"
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"nyoom-engineering/oxocarbon.nvim",
|
||||
config = function ()
|
||||
vim.o.background = "dark"
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme "oxocarbon"
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
-- the colorscheme should be available when starting Neovim
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||
priority = 1000, -- make sure to load this before all the other start plugins
|
||||
config = function()
|
||||
-- load the colorscheme here
|
||||
vim.cmd.colorscheme "tokyonight-storm"
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"sudormrfbin/cheatsheet.nvim",
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
'nvim-lua/popup.nvim',
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
config = true,
|
||||
}
|
||||
8
modules/home-manager/files/nvim/lua/plugins/dracula.lua
Normal file
8
modules/home-manager/files/nvim/lua/plugins/dracula.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"Mofiqul/dracula.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme "dracula"
|
||||
end,
|
||||
}
|
||||
19
modules/home-manager/files/nvim/lua/plugins/lualine.lua
Normal file
19
modules/home-manager/files/nvim/lua/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function ()
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'dracula-nvim',
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{
|
||||
'filename',
|
||||
path = 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls", -- lua
|
||||
"nil_ls", -- nix
|
||||
"puppet", -- puppet
|
||||
"ruff_lsp", -- python
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"nvimtools/none-ls.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = {
|
||||
"prettier", -- HTML, JS, JSON, etc.
|
||||
"ruff", -- Pyhton
|
||||
"stylua", -- LUA
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
1
modules/home-manager/files/nvim/lua/plugins/mason.lua
Normal file
1
modules/home-manager/files/nvim/lua/plugins/mason.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
return { "williamboman/mason.nvim", config = true }
|
||||
25
modules/home-manager/files/nvim/lua/plugins/neo-tree.lua
Normal file
25
modules/home-manager/files/nvim/lua/plugins/neo-tree.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
lazy = false,
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function ()
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
vim.keymap.set('n', '<C-n>', ':Neotree toggle<CR>', {})
|
||||
require("neo-tree").setup({
|
||||
filesystem = {
|
||||
hijack_netrw_behavior = "open_default"
|
||||
},
|
||||
follow_current_file = { enabled = true },
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
statusline = false
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
23
modules/home-manager/files/nvim/lua/plugins/none-ls.lua
Normal file
23
modules/home-manager/files/nvim/lua/plugins/none-ls.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.completion.spell,
|
||||
null_ls.builtins.diagnostics.puppet_lint,
|
||||
null_ls.builtins.diagnostics.rubocop,
|
||||
null_ls.builtins.diagnostics.ruff,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.puppet_lint,
|
||||
null_ls.builtins.formatting.rubocop,
|
||||
null_ls.builtins.formatting.ruff_format,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function ()
|
||||
local on_attach = function(_, _)
|
||||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
|
||||
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, {})
|
||||
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {})
|
||||
vim.keymap.set('n', 'gr', require('telescope.builtin').lsp_references, {})
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
|
||||
end
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup {
|
||||
on_attach = on_attach,
|
||||
settings = { Lua = { diagnostics = { globals = {'vim'} } } },
|
||||
}
|
||||
lspconfig.nil_ls.setup { on_attach = on_attach }
|
||||
local puppet_languageserver = vim.fn.expand("$HOME/.local/share/nvim/mason/packages/puppet-editor-services/libexec/puppet-languageserver")
|
||||
lspconfig.puppet.setup {
|
||||
on_attach = on_attach,
|
||||
cmd = { puppet_languageserver }
|
||||
}
|
||||
lspconfig.ruff_lsp.setup { on_attach = on_attach }
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
return { "nvim-tree/nvim-web-devicons", config = true }
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
config = function ()
|
||||
-- This is your opts table
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown({
|
||||
-- even more opts
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
-- load_extension, somewhere after setup function:
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
}
|
||||
|
||||
13
modules/home-manager/files/nvim/lua/plugins/telescope.lua
Normal file
13
modules/home-manager/files/nvim/lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.5",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function ()
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<Space><Space>', builtin.oldfiles, {})
|
||||
vim.keymap.set('n', '<Space>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<Space>fh', builtin.help_tags, {})
|
||||
end
|
||||
}
|
||||
53
modules/home-manager/files/nvim/lua/plugins/treesitter.lua
Normal file
53
modules/home-manager/files/nvim/lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function ()
|
||||
local config = require('nvim-treesitter.configs')
|
||||
config.setup {
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
sync_install = false,
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"css",
|
||||
"csv",
|
||||
"diff",
|
||||
"dockerfile",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitattributes",
|
||||
"gitignore",
|
||||
"go",
|
||||
"hcl",
|
||||
"hocon",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"nix",
|
||||
"passwd",
|
||||
"promql",
|
||||
"puppet",
|
||||
"python",
|
||||
"regex",
|
||||
--"pip_requirements",
|
||||
"ruby",
|
||||
"sql",
|
||||
"ssh_config",
|
||||
"terraform",
|
||||
"toml",
|
||||
"tsv",
|
||||
"typescript",
|
||||
"udev",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"xml",
|
||||
"yaml",
|
||||
},
|
||||
}
|
||||
end
|
||||
}
|
||||
5
modules/home-manager/files/nvim/lua/plugins/trouble.lua
Normal file
5
modules/home-manager/files/nvim/lua/plugins/trouble.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = true,
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"christoomey/vim-tmux-navigator"
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
return { "folke/which-key.nvim", config = true }
|
||||
|
|
@ -12,8 +12,6 @@
|
|||
hugo
|
||||
mas
|
||||
nmap
|
||||
nodejs
|
||||
nodePackages.npm
|
||||
openjdk
|
||||
sops
|
||||
ssh-to-age
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue