refactor: modularize home-manager config
This commit is contained in:
parent
98750e1a51
commit
e13ed446a1
28 changed files with 323 additions and 271 deletions
10
home-manager/fzf.nix
Normal file
10
home-manager/fzf.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
};
|
||||
}
|
39
home-manager/git.nix
Normal file
39
home-manager/git.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
user.private.name = "Michael Mandl";
|
||||
user.private.email = "mandlm@molez.net";
|
||||
user.private.signingkey = "4AA25D647AA54CC7";
|
||||
|
||||
user.swp.name = "Michael Mandl";
|
||||
user.swp.email = "mandl@vi-bim.de";
|
||||
user.swp.signingkey = "4E60F44227F611B4";
|
||||
|
||||
core.editor = "nvim";
|
||||
fetch.writeCommitGraph = true;
|
||||
format.pretty = "format:%C(yellow)%h %Cblue%>(12)%ad %C(red)%G? %Cgreen%<(7,trunc)%aN%Cred%d %Creset%s";
|
||||
init.defaultBranch = "main";
|
||||
log.date = "relative";
|
||||
pull.rebase = true;
|
||||
rebase.autostash = true;
|
||||
rerere.enabled = true;
|
||||
worktree.guessRemote = true;
|
||||
};
|
||||
|
||||
aliases = {
|
||||
identity = "! git config user.name \"$(git config user.$1.name)\"; git config user.email \"$(git config user.$1.email)\"; git config user.signingkey \"$(git config user.$1.signingkey)\"; git config commit.gpgsign \"true\"; :";
|
||||
};
|
||||
|
||||
ignores = [
|
||||
".env"
|
||||
".direnv"
|
||||
"*.swp"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
25
home-manager/gpg/default.nix
Normal file
25
home-manager/gpg/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
pinentryFlavor = "gtk2";
|
||||
extraConfig = ''
|
||||
allow-loopback-pinentry
|
||||
'';
|
||||
};
|
||||
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
mutableKeys = false;
|
||||
mutableTrust = false;
|
||||
publicKeys = [{
|
||||
source = ./pubring.asc;
|
||||
trust = "ultimate";
|
||||
}];
|
||||
settings = {
|
||||
pinentry-mode = "loopback";
|
||||
};
|
||||
};
|
||||
}
|
99
home-manager/gpg/pubring.asc
Normal file
99
home-manager/gpg/pubring.asc
Normal file
|
@ -0,0 +1,99 @@
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBF75iDUBEADKT7HJf29rKofixOegZt6C4fDWhgJuVa/tT/9CxBewpGuvt2an
|
||||
JM9eTO2ZUWjcbYc4zNsMppANKyr0+i9tve7f+hA5sXDbUNXXjxJz0tu2L3qToTqK
|
||||
fkvpy4D5dFQYB/N+9n1JKouXNcZKmoTzH9ur6gxmDTdrKcOzjsJQvFjg/nf3jLzT
|
||||
kj1REcCFxCqXQBVbnWObnaM/+2coofA11XO8KcA/qyVf2014Vj+LCtg8cYUWwOGn
|
||||
1nomHkJpqAD1k1wYfiEq+2wwgYP9Qvb1WhHzfpRmLT6C1RR9gqnWdNhkRPNrEXOV
|
||||
2lIAdKg0JJ2jZaOvblGfSA5ObndgwjCMu+0eE5bwSTYAXKwFoZC8/q78t1q2Wrgt
|
||||
s9+zUWFQiTltXtGhtwiaZLEmkj8Dlg3C3EltaJAOX06AkVQiGY/DUfFL5uVXDSyE
|
||||
2MBBFKk92ekGdFN6Vh1psw4lxQBUg/aGXA7zf+DR8UBQkGklDJPw0QbD15OEOsG0
|
||||
e1JbAa/rHt2w9a/Cn3Mzk18S0nwJXNmGk55Nm2TC5jNnP/COI6Pn2EE9t6RljBQT
|
||||
jsOtolHy74ss3xz1c6Q4yLmDQUspxrL3T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knep0wCuHw87t7xo7QK
|
||||
Zs1oBpJDqdJ8StocSotw8d7Nd2FZ7pU3qPGiOqbg8th/UDgYhqeM2jLOFHJ5FN5t
|
||||
JbcNWPcG2sDQPtd2u8RAoXTmoHBYa/07CrOhmFfUxE0yoOJxLZgVJNgzfmMX+Q6l
|
||||
4IjnRfpQmH5PINncJmWN/FB//MRDRtTjHdI9UAyyXOHdnaquT7SfwQXE8SHKInsd
|
||||
XcDAKNqRzNOG/92FOsbbhgRx2kyrhDdJRsh4zgV2OsNwBkY6wWUMM632PpIBauJN
|
||||
yAFNm1Xle81CCxO43APDVnfpxC2nkkoHwy6vJlF3S4DwRTbCPLMonMMyY43pRZnR
|
||||
Kumv0YJKKK8gV4hTYp1bc4fVDIgyfUmunFFA+LDwC09YbWSi9XJ7VveYD3T+l+qx
|
||||
Brq7XvOXTd3E6F31Q+U+cU95YFCRUL3yVl+U4hpHdOB0K4gORNlUKhFNfzz1iyUS
|
||||
tDXut79lup1kknfC4Fm3oJQFELMbnorkbnxp2HZnSjP2+yY9riV9vrCmN7+YihZC
|
||||
iL8jv/hUCyjfKBN5Qa14
|
||||
=dpaN
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
37
home-manager/i3.nix
Normal file
37
home-manager/i3.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
terminal = "${pkgs.kitty}/bin/kitty";
|
||||
|
||||
fonts = {
|
||||
names = [ "DejaVu Sans Mono" ];
|
||||
size = 12.0;
|
||||
};
|
||||
|
||||
window = {
|
||||
titlebar = false;
|
||||
border = 0;
|
||||
};
|
||||
|
||||
floating = {
|
||||
titlebar = false;
|
||||
border = 0;
|
||||
};
|
||||
|
||||
bars = [{
|
||||
mode = "hide";
|
||||
position = "top";
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml";
|
||||
|
||||
fonts = {
|
||||
names = [ "DejaVu Sans Mono" ];
|
||||
size = 12.0;
|
||||
};
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
41
home-manager/i3status-rust.nix
Normal file
41
home-manager/i3status-rust.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
programs.i3status-rust = {
|
||||
enable = true;
|
||||
bars = {
|
||||
default = {
|
||||
theme = "solarized-dark";
|
||||
icons = "awesome";
|
||||
|
||||
blocks = [
|
||||
{
|
||||
block = "memory";
|
||||
display_type = "memory";
|
||||
format_mem = "{mem_used_percents}";
|
||||
}
|
||||
{
|
||||
block = "cpu";
|
||||
interval = 1;
|
||||
format = "{barchart} {frequency}";
|
||||
}
|
||||
{
|
||||
block = "load";
|
||||
interval = 1;
|
||||
format = "{1m}";
|
||||
}
|
||||
{
|
||||
block = "battery";
|
||||
hide_missing = true;
|
||||
format = "{time} ({percentage})";
|
||||
}
|
||||
{
|
||||
block = "time";
|
||||
interval = 60;
|
||||
format = "%a %d.%m %R";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
14
home-manager/kitty.nix
Normal file
14
home-manager/kitty.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
kitty = {
|
||||
enable = true;
|
||||
theme = "Solarized Light";
|
||||
font = {
|
||||
name = "DejaVu Sans Mono";
|
||||
size = 12;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
1
home-manager/neovim/comment.lua
Normal file
1
home-manager/neovim/comment.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require('Comment').setup({})
|
93
home-manager/neovim/default.nix
Normal file
93
home-manager/neovim/default.nix
Normal file
|
@ -0,0 +1,93 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
# LSP
|
||||
sumneko-lua-language-server
|
||||
rnix-lsp
|
||||
terraform-ls
|
||||
tflint
|
||||
nodePackages.bash-language-server
|
||||
rust-analyzer
|
||||
];
|
||||
|
||||
programs = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
# theme
|
||||
nvim-solarized-lua
|
||||
|
||||
delimitMate
|
||||
vim-bbye
|
||||
ansible-vim
|
||||
|
||||
# session handling
|
||||
vim-obsession
|
||||
vim-prosession
|
||||
|
||||
nvim-web-devicons
|
||||
nvim-treesitter
|
||||
markdown-preview-nvim # use({ "iamcco/markdown-preview.nvim", run = ":call mkdp#util#install()" })
|
||||
toggleterm-nvim
|
||||
nvim-notify
|
||||
comment-nvim
|
||||
lualine-nvim
|
||||
tabline-nvim
|
||||
indent-blankline-nvim
|
||||
plenary-nvim
|
||||
|
||||
# git
|
||||
gitsigns-nvim
|
||||
vim-fugitive
|
||||
gv-vim
|
||||
|
||||
# snippets
|
||||
friendly-snippets
|
||||
luasnip
|
||||
|
||||
# auto-completion
|
||||
nvim-cmp
|
||||
cmp-nvim-lsp
|
||||
cmp-buffer
|
||||
cmp-path
|
||||
cmp-cmdline
|
||||
cmp-nvim-lua
|
||||
cmp_luasnip
|
||||
cmp-calc
|
||||
|
||||
# telescope
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
|
||||
# LSP
|
||||
nvim-lspconfig
|
||||
lsp-status-nvim
|
||||
rust-tools-nvim
|
||||
lua-dev-nvim
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
lua << EOF
|
||||
${builtins.readFile ./keymaps.lua }
|
||||
${builtins.readFile ./options.lua }
|
||||
${builtins.readFile ./treesitter.lua }
|
||||
${builtins.readFile ./lspconfig.lua }
|
||||
${builtins.readFile ./toggleterm.lua }
|
||||
${builtins.readFile ./notify.lua }
|
||||
${builtins.readFile ./comment.lua }
|
||||
${builtins.readFile ./lualine.lua }
|
||||
${builtins.readFile ./tabline.lua }
|
||||
${builtins.readFile ./indent-blankline.lua }
|
||||
${builtins.readFile ./gitsigns.lua }
|
||||
${builtins.readFile ./luasnip.lua }
|
||||
${builtins.readFile ./nvim-cmp.lua }
|
||||
${builtins.readFile ./telescope.lua }
|
||||
${builtins.readFile ./themes.lua }
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
1
home-manager/neovim/gitsigns.lua
Normal file
1
home-manager/neovim/gitsigns.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require('gitsigns').setup()
|
6
home-manager/neovim/indent-blankline.lua
Normal file
6
home-manager/neovim/indent-blankline.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
require("indent_blankline").setup {
|
||||
char = "┊",
|
||||
buftype_exclude = { "terminal", "help", "nofile" },
|
||||
filetype_exclude = { 'help', 'packer' },
|
||||
show_trailing_blankline_indent = false
|
||||
}
|
47
home-manager/neovim/keymaps.lua
Normal file
47
home-manager/neovim/keymaps.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
local function nnoremap(key, command)
|
||||
vim.api.nvim_set_keymap("n", key, command, { noremap = true })
|
||||
end
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Move around windows
|
||||
nnoremap("<C-h>", "<C-w>h")
|
||||
nnoremap("<C-j>", "<C-w>j")
|
||||
nnoremap("<C-k>", "<C-w>k")
|
||||
nnoremap("<C-l>", "<C-w>l")
|
||||
|
||||
-- Switch buffers
|
||||
nnoremap("<C-PageDown>", ":TablineBufferNext<CR>")
|
||||
nnoremap("<C-PageUp>", ":TablineBufferPrevious<CR>")
|
||||
|
||||
-- fugitive
|
||||
nnoremap("<leader>g", ":0Git<CR>")
|
||||
nnoremap("<leader>G", ":GV --all<CR>")
|
||||
|
||||
-- telescope
|
||||
nnoremap("<leader>ff", "<Cmd>Telescope find_files theme=dropdown<CR>")
|
||||
nnoremap("<leader>fb", "<Cmd>Telescope buffers theme=dropdown<CR>")
|
||||
nnoremap("<leader>fg", "<Cmd>Telescope git_files theme=dropdown<CR>")
|
||||
nnoremap("<C-f>", "<Cmd>Telescope grep_string<CR>")
|
||||
nnoremap("<C-g>", "<Cmd>Telescope live_grep<CR>")
|
||||
|
||||
-- terminal
|
||||
vim.api.nvim_create_autocmd("TermOpen", {
|
||||
pattern = "term://*",
|
||||
callback = function()
|
||||
local opts = { noremap = true }
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
|
||||
end,
|
||||
desc = "Map terminal esc and window switch keys",
|
||||
})
|
||||
|
||||
-- buffer closing
|
||||
nnoremap("<leader>q", ":Bdelete<CR>")
|
||||
|
||||
-- toggle search highlighting
|
||||
vim.cmd('nnoremap <expr> * v:hlsearch ? ":nohlsearch<cr>" : "*"')
|
90
home-manager/neovim/lspconfig.lua
Normal file
90
home-manager/neovim/lspconfig.lua
Normal file
|
@ -0,0 +1,90 @@
|
|||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local function nnoremap(key, command)
|
||||
vim.keymap.set("n", key, command, { noremap = true, silent = true, buffer = bufnr })
|
||||
end
|
||||
|
||||
local telescope = require("telescope.builtin")
|
||||
|
||||
nnoremap("gD", vim.lsp.buf.declaration)
|
||||
nnoremap("gd", telescope.lsp_definitions)
|
||||
nnoremap("gt", telescope.lsp_type_definitions)
|
||||
nnoremap("gi", telescope.lsp_implementations)
|
||||
nnoremap("gr", telescope.lsp_references)
|
||||
nnoremap("K", vim.lsp.buf.hover)
|
||||
nnoremap("<C-k>", vim.lsp.buf.signature_help)
|
||||
nnoremap("<leader>rn", vim.lsp.buf.rename)
|
||||
nnoremap("<leader>ca", vim.lsp.buf.code_action)
|
||||
nnoremap("<leader>f", vim.lsp.buf.formatting)
|
||||
nnoremap("<leader>d", telescope.diagnostics)
|
||||
nnoremap("<C-p>", vim.diagnostic.goto_prev)
|
||||
nnoremap("<C-n>", vim.diagnostic.goto_next)
|
||||
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.formatting_sync({}, 3000)
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
local lsp_status = require("lsp-status")
|
||||
lsp_status.config({
|
||||
current_function = false,
|
||||
show_filename = false,
|
||||
diagnostics = true,
|
||||
})
|
||||
lsp_status.register_progress()
|
||||
|
||||
local capabilities = vim.tbl_extend("keep", vim.lsp.protocol.make_client_capabilities(), lsp_status.capabilities)
|
||||
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
||||
|
||||
local servers = {
|
||||
["bashls"] = {},
|
||||
["rnix"] = {},
|
||||
["terraformls"] = {},
|
||||
["tflint"] = {},
|
||||
}
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
for lsp, settings in pairs(servers) do
|
||||
lspconfig[lsp].setup({
|
||||
settings = settings,
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
|
||||
require("rust-tools").setup({
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
loadOutDirsFromCheck = true,
|
||||
},
|
||||
checkOnSave = { command = "clippy" },
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = capabilities,
|
||||
},
|
||||
})
|
||||
|
||||
local luadev = require("lua-dev").setup({
|
||||
lspconfig = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
},
|
||||
runtime_path = true,
|
||||
})
|
||||
|
||||
lspconfig["sumneko_lua"].setup(luadev)
|
7
home-manager/neovim/lualine.lua
Normal file
7
home-manager/neovim/lualine.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
require('lualine').setup({
|
||||
options = { globalstatus = true },
|
||||
sections = {
|
||||
lualine_c = { { "filename", path = 1 }, "require('lsp-status').status()" }
|
||||
},
|
||||
extensions = { "toggleterm" }
|
||||
})
|
1
home-manager/neovim/luasnip.lua
Normal file
1
home-manager/neovim/luasnip.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require("luasnip.loaders.from_vscode").lazy_load()
|
2
home-manager/neovim/notify.lua
Normal file
2
home-manager/neovim/notify.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
require("notify").setup({ stages = "fade" })
|
||||
vim.notify = require("notify")
|
62
home-manager/neovim/nvim-cmp.lua
Normal file
62
home-manager/neovim/nvim-cmp.lua
Normal file
|
@ -0,0 +1,62 @@
|
|||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and
|
||||
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(
|
||||
col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
sources = require("cmp").config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer" },
|
||||
{ name = "nvim-lua" },
|
||||
{ name = "calc" },
|
||||
}),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
experimental = { ghost_text = true }
|
||||
})
|
||||
|
||||
-- `/` cmdline setup.
|
||||
cmp.setup.cmdline('/', { sources = { { name = 'buffer' } } })
|
||||
|
||||
-- `:` cmdline setup.
|
||||
cmp.setup.cmdline(':', {
|
||||
sources = cmp.config
|
||||
.sources({ { name = 'path' } }, { { name = 'cmdline' } })
|
||||
})
|
54
home-manager/neovim/options.lua
Normal file
54
home-manager/neovim/options.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
-- termguicolors
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- line numbers
|
||||
vim.opt.number = true
|
||||
|
||||
-- tabwidth
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
|
||||
-- indent with spaces
|
||||
vim.opt.expandtab = true
|
||||
|
||||
-- scroll offset
|
||||
vim.opt.scrolloff = 4
|
||||
|
||||
-- don't warp lines
|
||||
vim.opt.wrap = false
|
||||
|
||||
-- split to right/below
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
|
||||
-- presistent undo
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- searching
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
-- preview commands
|
||||
vim.opt.inccommand = "split"
|
||||
|
||||
-- completion
|
||||
vim.opt.completeopt = "menu,menuone,noselect"
|
||||
|
||||
-- set cursorline in active window
|
||||
vim.cmd([[
|
||||
augroup CursorLine
|
||||
autocmd!
|
||||
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline
|
||||
autocmd WinLeave * setlocal nocursorline
|
||||
augroup END
|
||||
]])
|
||||
|
||||
-- configure terminal
|
||||
vim.cmd([[
|
||||
augroup terminal_setup
|
||||
autocmd!
|
||||
autocmd TermOpen * startinsert
|
||||
autocmd TermOpen * setlocal nonumber norelativenumber
|
||||
augroup END
|
||||
]])
|
||||
|
1
home-manager/neovim/tabline.lua
Normal file
1
home-manager/neovim/tabline.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require('tabline').setup({ enable = true, options = { show_bufnr = true, show_filename_only = true } })
|
33
home-manager/neovim/telescope.lua
Normal file
33
home-manager/neovim/telescope.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local themes = require("telescope.themes")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<ESC>"] = actions.close,
|
||||
["<C-c>"] = actions.close
|
||||
},
|
||||
n = {
|
||||
["<ESC>"] = actions.close,
|
||||
["<C-c>"] = actions.close
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true
|
||||
},
|
||||
["ui-select"] = {
|
||||
themes.get_dropdown({})
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("ui-select")
|
2
home-manager/neovim/themes.lua
Normal file
2
home-manager/neovim/themes.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
vim.opt.background = 'light'
|
||||
vim.cmd("colorscheme solarized")
|
1
home-manager/neovim/toggleterm.lua
Normal file
1
home-manager/neovim/toggleterm.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require("toggleterm").setup({ size = 32, open_mapping = [[<F4>]] })
|
9
home-manager/neovim/treesitter.lua
Normal file
9
home-manager/neovim/treesitter.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
require('nvim-treesitter.configs').setup({
|
||||
highlight = {enable = true, additional_vim_regex_highlighting = false},
|
||||
indent = {enable = true},
|
||||
ensure_installed = {
|
||||
"bash", "c", "cpp", "css", "dockerfile", "hcl", "html", "javascript",
|
||||
"json", "latex", "lua", "markdown", "nix", "python", "rust", "svelte",
|
||||
"toml", "tsx", "typescript", "vim", "vue", "yaml"
|
||||
}
|
||||
})
|
11
home-manager/starship.nix
Normal file
11
home-manager/starship.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = lib.concatStrings [ "$all" "$directory" "$character" ];
|
||||
hostname.format = "[$ssh_symbol$hostname]($style) ";
|
||||
};
|
||||
};
|
||||
}
|
20
home-manager/tmux.nix
Normal file
20
home-manager/tmux.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
newSession = true;
|
||||
keyMode = "vi";
|
||||
escapeTime = 10;
|
||||
terminal = "tmux-256color";
|
||||
|
||||
extraConfig = ''
|
||||
set-option -g status off
|
||||
'';
|
||||
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
vim-tmux-navigator
|
||||
tmux-colors-solarized
|
||||
];
|
||||
};
|
||||
}
|
20
home-manager/zsh.nix
Normal file
20
home-manager/zsh.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableSyntaxHighlighting = true;
|
||||
history.size = 10000;
|
||||
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [ "direnv" "tmux" "vi-mode" ];
|
||||
};
|
||||
|
||||
localVariables = {
|
||||
ZSH_TMUX_AUTOSTART = true;
|
||||
ZSH_TMUX_AUTOCONNECT = true;
|
||||
ZSH_TMUX_UNICODE = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue