nixbook: update and fix nixvim
This commit is contained in:
parent
1828a2f264
commit
5dc7980032
2 changed files with 139 additions and 177 deletions
|
|
@ -13,8 +13,29 @@
|
|||
|
||||
undofile = true;
|
||||
};
|
||||
extraPlugins = [(pkgs.vimPlugins.actions-preview-nvim)];
|
||||
extraConfigLua = ''
|
||||
vim.o.undodir = vim.fn.expand("$HOME/.local/share/nvim/undo")
|
||||
require("actions-preview").setup {
|
||||
highlight_command = {
|
||||
require("actions-preview.highlight").delta("${pkgs.delta}/bin/delta --no-gitconfig --side-by-side"),
|
||||
},
|
||||
telescope = {
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
width = 0.8,
|
||||
height = 0.9,
|
||||
prompt_position = "top",
|
||||
preview_cutoff = 20,
|
||||
preview_height = function(_, _, max_lines)
|
||||
return max_lines - 10
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
vim.keymap.set({ "v", "n" }, "<C-.>", require("actions-preview").code_actions)
|
||||
vim.keymap.set({ "n" }, "<leader>ca", require("actions-preview").code_actions)
|
||||
'';
|
||||
keymaps = [
|
||||
{
|
||||
|
|
@ -22,6 +43,12 @@
|
|||
action = ''"+y'';
|
||||
options.desc = "copy to clipboard";
|
||||
}
|
||||
{
|
||||
key = "<leader>ca";
|
||||
action = ''
|
||||
require("actions-preview").code_actions
|
||||
'';
|
||||
}
|
||||
{
|
||||
key = "gl";
|
||||
action = "g$";
|
||||
|
|
@ -59,7 +86,8 @@
|
|||
|
||||
plugins = {
|
||||
bufferline.enable = true;
|
||||
surround.enable = true;
|
||||
web-devicons.enable = true;
|
||||
vim-surround.enable = true;
|
||||
comment.enable = true;
|
||||
|
||||
markdown-preview.enable = true;
|
||||
|
|
@ -79,25 +107,26 @@
|
|||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
tsserver.enable = true;
|
||||
ts-ls.enable = true;
|
||||
nil-ls.enable = true;
|
||||
};
|
||||
keymaps = {
|
||||
lspBuf = {
|
||||
"<leader>ck" = "hover";
|
||||
"K" = "hover";
|
||||
"<leader>ca" = "code_action";
|
||||
|
||||
# using actions-preview instead
|
||||
# "<leader>ca" = "code_action";
|
||||
# "<C-.>" = "code_action";
|
||||
|
||||
"<leader>cd" = "definition";
|
||||
"gd" = "definition";
|
||||
};
|
||||
diagnostic = {
|
||||
"<leader>e" = "open_float";
|
||||
"<leader>ca" = "code_action";
|
||||
"<C-.>" = "code_action";
|
||||
|
||||
"<leader>cf" = "references";
|
||||
"gr" = "references";
|
||||
|
||||
"<leader>cr" = "rename";
|
||||
"gd" = "definition";
|
||||
};
|
||||
diagnostic = {
|
||||
"<leader>ch" = "open_float";
|
||||
"<C-e>" = "open_float";
|
||||
"<F2>" = "rename";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -134,4 +163,5 @@
|
|||
|
||||
vim-css-color.enable = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue