Compare commits
No commits in common. "8075ec0091af825eb9e1c667e849312d27eca7d4" and "ad82b2f136532401f2c6f45359af2d8f742bc905" have entirely different histories.
8075ec0091
...
ad82b2f136
7 changed files with 103 additions and 164 deletions
|
|
@ -3,23 +3,18 @@
|
||||||
let
|
let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.delta = {
|
|
||||||
enable = true;
|
|
||||||
options = {
|
|
||||||
side-by-side = true;
|
|
||||||
line-numbers = true;
|
|
||||||
};
|
|
||||||
enableGitIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
userName = "Haak Saxberg";
|
||||||
user = {
|
userEmail = "haak.erling@gmail.com";
|
||||||
name = "Haak Saxberg";
|
delta = {
|
||||||
email = "haak.erling@gmail.com";
|
enable = true;
|
||||||
|
options = {
|
||||||
|
side-by-side = true;
|
||||||
|
line-numbers = true;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
extraConfig = {
|
||||||
rebase = {
|
rebase = {
|
||||||
updateRefs = true;
|
updateRefs = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,33 +28,26 @@ with builtins;
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
vim-sensible
|
vim-sensible
|
||||||
{
|
vim-startify
|
||||||
plugin = vim-precognition;
|
|
||||||
config = ''
|
|
||||||
lua << EOF
|
|
||||||
require("precognition").setup({})
|
|
||||||
EOF
|
|
||||||
noremap ? :lua require("precognition").peek()<CR>
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
plenary-nvim
|
|
||||||
{
|
|
||||||
plugin = nvim-treesitter-legacy.withAllGrammars;
|
|
||||||
config = ''
|
|
||||||
lua << EOF
|
|
||||||
require'nvim-treesitter.configs'.setup {
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
||||||
# cosmetic improvements
|
|
||||||
catppuccin-nvim
|
catppuccin-nvim
|
||||||
vim-illuminate # highlight cursor-word
|
vim-precognition
|
||||||
nvim-web-devicons
|
nvim-treesitter.withAllGrammars
|
||||||
|
|
||||||
|
{
|
||||||
|
plugin = fzf-vim;
|
||||||
|
config = ''
|
||||||
|
noremap <leader>fc :BCommits<CR>
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
vim-elixir
|
||||||
|
alchemist-vim
|
||||||
|
vim-nix
|
||||||
|
vim-javascript
|
||||||
|
vim-json
|
||||||
|
vim-jsx-pretty
|
||||||
|
|
||||||
|
vim-commentary
|
||||||
|
vim-airline
|
||||||
{
|
{
|
||||||
plugin = rainbow;
|
plugin = rainbow;
|
||||||
config = ''
|
config = ''
|
||||||
|
|
@ -73,58 +66,37 @@ with builtins;
|
||||||
let g:indent_guides_start_level = 2
|
let g:indent_guides_start_level = 2
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
# language-agnostic editor improvements
|
|
||||||
{
|
|
||||||
plugin = fzf-vim;
|
|
||||||
config = ''
|
|
||||||
noremap <leader>fc :BCommits<CR>
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
which-key-nvim
|
|
||||||
{
|
|
||||||
plugin = alpha-nvim;
|
|
||||||
config = ''
|
|
||||||
lua << EOF
|
|
||||||
local alpha = require("alpha");
|
|
||||||
local dashboard = require("alpha.themes.startify");
|
|
||||||
alpha.setup(dashboard.config);
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = nvim-autopairs;
|
|
||||||
config = ''
|
|
||||||
lua << EOF
|
|
||||||
require("nvim-autopairs").setup {}
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = lualine-nvim;
|
|
||||||
config = ''
|
|
||||||
lua << EOF
|
|
||||||
require('lualine').setup()
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = comment-nvim;
|
|
||||||
config = ''
|
|
||||||
lua << EOF
|
|
||||||
require('Comment').setup()
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
vim-surround
|
vim-surround
|
||||||
{
|
{
|
||||||
# file explorer
|
plugin = vim-fugitive;
|
||||||
plugin = oil-nvim;
|
|
||||||
config = ''
|
config = ''
|
||||||
lua << EOF
|
nnoremap gb :Git blame<CR>
|
||||||
require("oil").setup()
|
'';
|
||||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
}
|
||||||
EOF
|
{
|
||||||
|
plugin = git-blame-nvim;
|
||||||
|
config = ''
|
||||||
|
let g:gitblame_date_format = '%Y-%m-%d'
|
||||||
|
nnoremap gC :GitBlameOpenCommitURL<CR>
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = neogit;
|
||||||
|
config = ''
|
||||||
|
noremap <leader>g :Neogit<CR>
|
||||||
|
lua << EOF
|
||||||
|
local neogit = require('neogit')
|
||||||
|
neogit.setup {}
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
vinegar
|
||||||
|
{
|
||||||
|
plugin = gitsigns-nvim;
|
||||||
|
config = ''
|
||||||
|
lua << EOF
|
||||||
|
require('gitsigns').setup()
|
||||||
|
EOF
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|
@ -146,42 +118,6 @@ with builtins;
|
||||||
endif
|
endif
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
|
||||||
plugin = telescope-nvim;
|
|
||||||
config = ''
|
|
||||||
nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>
|
|
||||||
nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>
|
|
||||||
nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>
|
|
||||||
nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
nvim-dap
|
|
||||||
nvim-dap-ui
|
|
||||||
|
|
||||||
# Git stuff
|
|
||||||
{
|
|
||||||
plugin = vim-fugitive;
|
|
||||||
config = ''
|
|
||||||
nnoremap gb :Git blame<CR>
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = git-blame-nvim;
|
|
||||||
config = ''
|
|
||||||
let g:gitblame_date_format = '%Y-%m-%d'
|
|
||||||
nnoremap gC :GitBlameOpenCommitURL<CR>
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = gitsigns-nvim;
|
|
||||||
config = ''
|
|
||||||
lua << EOF
|
|
||||||
require('gitsigns').setup()
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
||||||
# Language servers
|
|
||||||
cmp-nvim-lsp
|
cmp-nvim-lsp
|
||||||
{
|
{
|
||||||
plugin = nvim-lspconfig;
|
plugin = nvim-lspconfig;
|
||||||
|
|
@ -193,20 +129,22 @@ with builtins;
|
||||||
# we'll probably always want them around.
|
# we'll probably always want them around.
|
||||||
lua_ls = pkgs.lua-language-server;
|
lua_ls = pkgs.lua-language-server;
|
||||||
nixd = pkgs.nixd;
|
nixd = pkgs.nixd;
|
||||||
|
ts_server = pkgs.nodePackages.typescript-language-server;
|
||||||
# Nearly always want the diagnostic server
|
|
||||||
diagnostic_server = pkgs.nodePackages.diagnostic-languageserver;
|
diagnostic_server = pkgs.nodePackages.diagnostic-languageserver;
|
||||||
}
|
}
|
||||||
) }
|
) }
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
# language-specific plugins
|
plugin = telescope-nvim;
|
||||||
vim-nix
|
config = ''
|
||||||
vim-json
|
nnoremap <leader>ff <cmd>lua require('telescope.builtin').find_files()<cr>
|
||||||
dart-vim-plugin
|
nnoremap <leader>fg <cmd>lua require('telescope.builtin').live_grep()<cr>
|
||||||
|
nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>
|
||||||
|
nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>
|
||||||
|
'';
|
||||||
|
}
|
||||||
# have the completion plugin get loaded last just in case anything above
|
# have the completion plugin get loaded last just in case anything above
|
||||||
# needs to do setup work before completions get set up.
|
# needs to do setup work before completions get set up.
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ autocmd BufWritePre * :%s/\s\+$//e
|
||||||
noremap ; :
|
noremap ; :
|
||||||
inoremap jj <Esc>
|
inoremap jj <Esc>
|
||||||
noremap Q <nop>
|
noremap Q <nop>
|
||||||
|
noremap ? :lua require("precognition").peek()<CR>
|
||||||
|
|
||||||
""" Esperanto digraphs (for use with ctrl-k)
|
""" Esperanto digraphs (for use with ctrl-k)
|
||||||
:digraph Cx 264
|
:digraph Cx 264
|
||||||
|
|
@ -84,3 +85,11 @@ set scrolloff=10
|
||||||
if filereadable($HOME . "/.vimrc.local")
|
if filereadable($HOME . "/.vimrc.local")
|
||||||
source ~/.vimrc.local
|
source ~/.vimrc.local
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
lua << EOF
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
vim.lsp.config('*', {
|
local nvim_lsp = require("lspconfig")
|
||||||
capabilities = require("cmp_nvim_lsp").default_capabilities()
|
--
|
||||||
})
|
-- https://vonheikemen.github.io/devlog/tools/setup-nvim-lspconfig-plus-nvim-cmp/
|
||||||
|
local lsp_defaults = nvim_lsp.util.default_config
|
||||||
|
lsp_defaults.capabilities = vim.tbl_deep_extend(
|
||||||
|
'force',
|
||||||
|
lsp_defaults.capabilities,
|
||||||
|
require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
)
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
desc = "LSP actions",
|
desc = "LSP actions",
|
||||||
|
|
@ -55,7 +61,7 @@ vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config("diagnosticls", {
|
nvim_lsp.diagnosticls.setup {
|
||||||
cmd = { "@diagnostic_server@/bin/diagnostic-languageserver", '--stdio' },
|
cmd = { "@diagnostic_server@/bin/diagnostic-languageserver", '--stdio' },
|
||||||
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'css', 'scss', 'markdown', 'pandoc',
|
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'css', 'scss', 'markdown', 'pandoc',
|
||||||
'prisma' },
|
'prisma' },
|
||||||
|
|
@ -134,37 +140,34 @@ vim.lsp.config("diagnosticls", {
|
||||||
prisma = 'prettier'
|
prisma = 'prettier'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
vim.lsp.enable("diagnosticls");
|
|
||||||
|
|
||||||
vim.lsp.config("elmls", {})
|
nvim_lsp.elmls.setup {
|
||||||
|
}
|
||||||
|
|
||||||
local capabilitiesWithoutFomatting = vim.lsp.protocol.make_client_capabilities()
|
local capabilitiesWithoutFomatting = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilitiesWithoutFomatting.textDocument.formatting = false
|
capabilitiesWithoutFomatting.textDocument.formatting = false
|
||||||
capabilitiesWithoutFomatting.textDocument.rangeFormatting = false
|
capabilitiesWithoutFomatting.textDocument.rangeFormatting = false
|
||||||
capabilitiesWithoutFomatting.textDocument.range_formatting = false
|
capabilitiesWithoutFomatting.textDocument.range_formatting = false
|
||||||
|
|
||||||
vim.lsp.config("ts_ls", {
|
nvim_lsp.ts_ls.setup {
|
||||||
cmd = { "typescript-language-server", '--stdio' },
|
cmd = { "@ts_server@/bin/typescript-language-server", '--stdio' },
|
||||||
init_options = {
|
init_options = {
|
||||||
hostInfo = "neovim",
|
hostInfo = "neovim",
|
||||||
maxTsServerMemory = "8192",
|
maxTsServerMemory = "8192",
|
||||||
preferences = { quotePreference = "single", allowIncompleteCompletions = false },
|
preferences = { quotePreference = "single", allowIncompleteCompletions = false },
|
||||||
capabilities = capabilitiesWithoutFomatting
|
capabilities = capabilitiesWithoutFomatting
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
vim.lsp.config("elixirls", {
|
nvim_lsp.elixirls.setup {
|
||||||
cmd = { "elixir-ls" },
|
cmd = { "elixir-ls" },
|
||||||
})
|
}
|
||||||
|
nvim_lsp.nixd.setup {
|
||||||
vim.lsp.config("nixd", {
|
|
||||||
cmd = { "@nixd@/bin/nixd" },
|
cmd = { "@nixd@/bin/nixd" },
|
||||||
});
|
}
|
||||||
vim.lsp.enable("nixd");
|
nvim_lsp.rust_analyzer.setup {}
|
||||||
|
|
||||||
vim.lsp.config("rust_analyzer", {})
|
nvim_lsp.lua_ls.setup {
|
||||||
|
|
||||||
vim.lsp.config("lua_ls", {
|
|
||||||
cmd = { "@lua_ls@/bin/lua-language-server" },
|
cmd = { "@lua_ls@/bin/lua-language-server" },
|
||||||
single_file_support = true,
|
single_file_support = true,
|
||||||
flags = {
|
flags = {
|
||||||
|
|
@ -177,10 +180,8 @@ vim.lsp.config("lua_ls", {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
vim.lsp.config("texlab", {})
|
nvim_lsp.texlab.setup {}
|
||||||
|
|
||||||
vim.lsp.config("gleam", {})
|
nvim_lsp.gleam.setup {}
|
||||||
|
|
||||||
vim.lsp.config("dartls", {})
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
# A command-line file manager
|
|
||||||
programs.yazi = {
|
programs.yazi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
shellWrapperName = "y";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
with builtins; {
|
with builtins; {
|
||||||
|
|
||||||
|
|
@ -22,8 +22,6 @@ with builtins; {
|
||||||
"vi-mode"
|
"vi-mode"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
dotDir = "${config.xdg.configHome}/zsh";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home.file.".oh-my-zsh/custom/themes/typewritten.zsh-theme" = {
|
home.file.".oh-my-zsh/custom/themes/typewritten.zsh-theme" = {
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ with builtins;
|
||||||
(import ./programs/zsh)
|
(import ./programs/zsh)
|
||||||
(import ./programs/tmux)
|
(import ./programs/tmux)
|
||||||
(import ./programs/nvim)
|
(import ./programs/nvim)
|
||||||
# (import ./programs/helix)
|
(import ./programs/helix)
|
||||||
# (import ./programs/yazi)
|
(import ./programs/yazi)
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = defaultPkgs;
|
home.packages = defaultPkgs;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue