Compare commits
4 commits
a3709a8979
...
fdf7775c73
Author | SHA1 | Date | |
---|---|---|---|
fdf7775c73 | |||
aea55dcd6c | |||
493148c3b8 | |||
4af5cb648b |
10 changed files with 132 additions and 83 deletions
|
@ -1,6 +1,6 @@
|
||||||
# Nixvim
|
# Nixvim
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
[ ] Open last active buffer after :bd
|
- [ ] Open last active buffer after :bd
|
||||||
[ ] Code action
|
- [ ] Code action
|
||||||
[ ] DAP support
|
- [ ] DAP support
|
||||||
|
|
40
config/blink.nix
Normal file
40
config/blink.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
|
||||||
|
plugins = {
|
||||||
|
blink-cmp = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
keymap = {
|
||||||
|
"<C-p>" = [
|
||||||
|
"scroll_documentation_up"
|
||||||
|
"fallback"
|
||||||
|
];
|
||||||
|
"<C-n>" = [
|
||||||
|
"scroll_documentation_down"
|
||||||
|
"fallback"
|
||||||
|
];
|
||||||
|
"<C-j>" = [
|
||||||
|
"select_next"
|
||||||
|
"fallback"
|
||||||
|
];
|
||||||
|
"<C-k>" = [
|
||||||
|
"select_prev"
|
||||||
|
"fallback"
|
||||||
|
];
|
||||||
|
"<C-space>" = [
|
||||||
|
"show"
|
||||||
|
"show_documentation"
|
||||||
|
"hide_documentation"
|
||||||
|
"fallback"
|
||||||
|
];
|
||||||
|
"<Tab>" = [
|
||||||
|
"select_and_accept"
|
||||||
|
"fallback"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
cmp-nvim-lsp.enable = true;
|
||||||
|
cmp.enable = true;
|
||||||
|
};
|
||||||
|
}
|
23
config/buffer/bufdelete.nix
Normal file
23
config/buffer/bufdelete.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ helpers, ... }:
|
||||||
|
{
|
||||||
|
plugins = {
|
||||||
|
bufdelete = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
keymaps = [
|
||||||
|
{
|
||||||
|
mode = [ "n" ];
|
||||||
|
key = "<C-x>";
|
||||||
|
action = helpers.mkRaw ''
|
||||||
|
function()
|
||||||
|
require("bufdelete").bufdelete(0, false)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
options = {
|
||||||
|
desc = "Toggle terminal";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
{
|
{
|
||||||
# Import all your configuration modules here
|
# Import all your configuration modules here
|
||||||
imports = [
|
imports = [
|
||||||
|
./buffer/bufdelete.nix
|
||||||
|
./blink.nix
|
||||||
./bufferline.nix
|
./bufferline.nix
|
||||||
./comment.nix
|
./comment.nix
|
||||||
./core.nix
|
./core.nix
|
||||||
|
@ -14,7 +16,6 @@
|
||||||
./lsp
|
./lsp
|
||||||
./lualine.nix
|
./lualine.nix
|
||||||
./neo-tree.nix
|
./neo-tree.nix
|
||||||
./nvim-cmp.nix
|
|
||||||
# ./project.nix
|
# ./project.nix
|
||||||
./rainbow-delimiters.nix
|
./rainbow-delimiters.nix
|
||||||
./telescope.nix
|
./telescope.nix
|
||||||
|
@ -22,6 +23,5 @@
|
||||||
./treesitter.nix
|
./treesitter.nix
|
||||||
./which-key.nix
|
./which-key.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
plugins.web-devicons.enable = true;
|
plugins.web-devicons.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,53 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
plugins.harpoon = {
|
# keymaps for this plugin are difined in config/keymaps/window-movements module
|
||||||
enable = true;
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
};
|
harpoon2
|
||||||
|
];
|
||||||
|
extraConfigLua = ''
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
harpoon:setup(
|
||||||
|
{
|
||||||
|
settings = {
|
||||||
|
save_on_toggle = true,
|
||||||
|
sync_on_ui_close = true,
|
||||||
|
key = function()
|
||||||
|
return vim.loop.cwd()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
-- basic telescope configuration
|
||||||
|
-- local conf = require("telescope.config").values
|
||||||
|
-- local function toggle_telescope(harpoon_files)
|
||||||
|
-- local file_paths = {}
|
||||||
|
-- for _, item in ipairs(harpoon_files.items) do
|
||||||
|
-- table.insert(file_paths, item.value)
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- require("telescope.pickers").new({}, {
|
||||||
|
-- prompt_title = "Harpoon",
|
||||||
|
-- finder = require("telescope.finders").new_table({
|
||||||
|
-- results = file_paths,
|
||||||
|
-- }),
|
||||||
|
-- previewer = conf.file_previewer({}),
|
||||||
|
-- sorter = conf.generic_sorter({}),
|
||||||
|
-- layout_strategy = getLayoutStrategy()
|
||||||
|
-- }):find()
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
|
||||||
|
-- { desc = "Open harpoon window" })
|
||||||
|
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||||
|
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<C-a>", function() harpoon:list():select(1) end)
|
||||||
|
vim.keymap.set("n", "<C-s>", function() harpoon:list():select(2) end)
|
||||||
|
vim.keymap.set("n", "<C-f>", function() harpoon:list():select(3) end)
|
||||||
|
vim.keymap.set("n", "<C-g>", function() harpoon:list():select(4) end)
|
||||||
|
-- Toggle previous & next buffers stored within Harpoon list
|
||||||
|
vim.keymap.set("n", "<C-S-k>", function() harpoon:list():prev() end)
|
||||||
|
vim.keymap.set("n", "<C-S-j>", function() harpoon:list():next() end)
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,14 +83,5 @@
|
||||||
desc = "Next Buffer";
|
desc = "Next Buffer";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
mode = [ "n" "i" ];
|
|
||||||
key = "<S-Tab>";
|
|
||||||
action = "<cmd>tabprevious<cr>";
|
|
||||||
options = {
|
|
||||||
desc = "Previous Tab";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
terraformls = {
|
terraformls = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
gopls = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
inlayHints = true;
|
inlayHints = true;
|
||||||
keymaps = {
|
keymaps = {
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
{
|
|
||||||
plugins = {
|
|
||||||
cmp = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
sources = [
|
|
||||||
{ name = "nvim_lsp"; }
|
|
||||||
{
|
|
||||||
name = "buffer"; # text within current buffer
|
|
||||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
|
||||||
keywordLength = 3;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "path"; # file system paths
|
|
||||||
keywordLength = 3;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "luasnip"; # snippets
|
|
||||||
keywordLength = 3;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
mapping = {
|
|
||||||
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
|
||||||
"<C-j>" = "cmp.mapping.select_next_item()";
|
|
||||||
"<C-k>" = "cmp.mapping.select_prev_item()";
|
|
||||||
"<C-e>" = "cmp.mapping.abort()";
|
|
||||||
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
|
|
||||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
|
||||||
"<C-Space>" = "cmp.mapping.complete()";
|
|
||||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
|
||||||
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
cmp-nvim-lsp.enable = true;
|
|
||||||
cmp-path.enable = true;
|
|
||||||
cmp-buffer.enable = true;
|
|
||||||
};
|
|
||||||
keymaps = [
|
|
||||||
# Need to map macro recording to another key due to:
|
|
||||||
# https://github.com/hrsh7th/nvim-cmp/issues/1692
|
|
||||||
{
|
|
||||||
mode = [ "n" ];
|
|
||||||
key = "<leader>q";
|
|
||||||
action = "q";
|
|
||||||
options = {
|
|
||||||
noremap = true;
|
|
||||||
silent = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mode = [ "n" ];
|
|
||||||
key = "q";
|
|
||||||
action = "<Nop>";
|
|
||||||
options = {
|
|
||||||
noremap = true;
|
|
||||||
silent = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -6,7 +6,10 @@
|
||||||
};
|
};
|
||||||
keymaps = [
|
keymaps = [
|
||||||
{
|
{
|
||||||
mode = [ "n" "i" ];
|
mode = [
|
||||||
|
"n"
|
||||||
|
"i"
|
||||||
|
];
|
||||||
key = "<C-p>";
|
key = "<C-p>";
|
||||||
action = helpers.mkRaw ''
|
action = helpers.mkRaw ''
|
||||||
function()
|
function()
|
||||||
|
@ -18,11 +21,14 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = [ "n" "i" ];
|
mode = [
|
||||||
|
"n"
|
||||||
|
"i"
|
||||||
|
];
|
||||||
key = "<C-S-p>";
|
key = "<C-S-p>";
|
||||||
action = helpers.mkRaw ''
|
action = helpers.mkRaw ''
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").help_tags()
|
require("telescope.builtin").live_grep()
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
keymaps = [
|
keymaps = [
|
||||||
|
{
|
||||||
{
|
|
||||||
mode = [ "n" ];
|
mode = [ "n" ];
|
||||||
key = "<leader>tt";
|
key = "<leader>tt";
|
||||||
action = "<cmd>ToggleTerm<cr>";
|
action = "<cmd>ToggleTerm<cr>";
|
||||||
|
|
Loading…
Add table
Reference in a new issue