chore: move out of useless nixos directory
This commit is contained in:
parent
f76bee6384
commit
ec6d839450
52 changed files with 0 additions and 0 deletions
5
nixvim/config/bufferline.nix
Normal file
5
nixvim/config/bufferline.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
plugins.bufferline = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
6
nixvim/config/clipboard.nix
Normal file
6
nixvim/config/clipboard.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
clipboard = {
|
||||
providers.xsel.enable = true;
|
||||
register = "unnamedplus";
|
||||
};
|
||||
}
|
||||
19
nixvim/config/cmp.nix
Normal file
19
nixvim/config/cmp.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
plugins.cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "path"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
|
||||
mapping = {
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item({'i', 's'}))";
|
||||
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item({'i', 's'}))";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
188
nixvim/config/dap.nix
Normal file
188
nixvim/config/dap.nix
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
plugins.dap = {
|
||||
enable = true;
|
||||
extensions = {
|
||||
dap-ui.enable = true;
|
||||
dap-virtual-text.enable = true;
|
||||
};
|
||||
adapters = {
|
||||
executables = {
|
||||
gdb = {
|
||||
command = "gdb";
|
||||
args = [ "-i" "dap" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
configurations = {
|
||||
c = [
|
||||
{
|
||||
name = "Launch";
|
||||
type = "gdb";
|
||||
request = "launch";
|
||||
program.__raw = # lua
|
||||
''
|
||||
function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. '/', "file")
|
||||
end
|
||||
'';
|
||||
args.__raw = # lua
|
||||
''
|
||||
function()
|
||||
return vim.fn.input("Args: ", "", "file")
|
||||
end
|
||||
'';
|
||||
cwd = ''''${workspacefolder}'';
|
||||
stopOnEntry = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>db";
|
||||
action = ":DapToggleBreakpoint<cr>";
|
||||
options.desc = "Toggle Breakpoint";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dc";
|
||||
action = ":DapContinue<cr>";
|
||||
options.desc = "Continue";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>da";
|
||||
action = "<cmd>lua require('dap').continue({ before = get_args })<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Run with Args";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dC";
|
||||
action = "<cmd>lua require('dap').run_to_cursor()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Run to cursor";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dg";
|
||||
action = "<cmd>lua require('dap').goto_()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go to line (no execute)";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>di";
|
||||
action = ":DapStepInto<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Step into";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dj";
|
||||
action = "
|
||||
<cmd>lua require('dap').down()<cr>
|
||||
";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Down";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dk";
|
||||
action = "<cmd>lua require('dap').up()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Up";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dl";
|
||||
action = "<cmd>lua require('dap').run_last()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Run Last";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>do";
|
||||
action = ":DapStepOut<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Step Out";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dO";
|
||||
action = ":DapStepOver<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Step Over";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dp";
|
||||
action = "<cmd>lua require('dap').pause()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Pause";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dr";
|
||||
action = ":DapToggleRepl<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle REPL";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ds";
|
||||
action = "<cmd>lua require('dap').session()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Session";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dt";
|
||||
action = ":DapTerminate<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Terminate";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>du";
|
||||
action.__raw = # lua
|
||||
''
|
||||
function()
|
||||
require("dapui").toggle()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Toggle Debugger UI";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
29
nixvim/config/default.nix
Normal file
29
nixvim/config/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
# Import all your configuration modules here
|
||||
imports = [
|
||||
# base config
|
||||
./options.nix
|
||||
./clipboard.nix
|
||||
|
||||
# appearence
|
||||
./bufferline.nix
|
||||
./lualine.nix
|
||||
./which-key.nix
|
||||
./toggleterm.nix
|
||||
|
||||
# file and search utilities
|
||||
./telescope.nix
|
||||
./oil.nix
|
||||
|
||||
# language support & lsp
|
||||
./lsp.nix
|
||||
./treesitter.nix
|
||||
./nix.nix
|
||||
|
||||
# debugging
|
||||
./dap.nix
|
||||
|
||||
# autocompletion
|
||||
./cmp.nix
|
||||
];
|
||||
}
|
||||
7
nixvim/config/extra_config.lua
Normal file
7
nixvim/config/extra_config.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require('telescope-all-recent').setup({
|
||||
default = {
|
||||
disable = false;
|
||||
use_cwd = true,
|
||||
sorting = "frecency",
|
||||
}
|
||||
})
|
||||
32
nixvim/config/lsp.nix
Normal file
32
nixvim/config/lsp.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
plugins.lsp = {
|
||||
enable = true;
|
||||
inlayHints = true;
|
||||
servers = {
|
||||
nixd.enable = true;
|
||||
cssls.enable = true;
|
||||
html.enable = true;
|
||||
rust-analyzer = {
|
||||
enable = true;
|
||||
installRustc = true;
|
||||
installCargo = true;
|
||||
};
|
||||
bashls.enable = true;
|
||||
clangd.enable = true;
|
||||
};
|
||||
keymaps = {
|
||||
diagnostic = {
|
||||
"<C-n>" = "goto_next";
|
||||
"<C-p>" = "goto_prev";
|
||||
};
|
||||
lspBuf = {
|
||||
"K" = "hover";
|
||||
"gD" = "references";
|
||||
"gd" = "definition";
|
||||
"gi" = "implementation";
|
||||
"gt" = "type_definition";
|
||||
"<C-,>" = "code_action";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
nixvim/config/lualine.nix
Normal file
5
nixvim/config/lualine.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
plugins.lualine = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
3
nixvim/config/nix.nix
Normal file
3
nixvim/config/nix.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
plugins.nix.enable = true;
|
||||
}
|
||||
9
nixvim/config/oil.nix
Normal file
9
nixvim/config/oil.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# https://nix-community.github.io/nixvim/plugins/oil/
|
||||
{
|
||||
plugins.oil = {
|
||||
enable = true;
|
||||
settings = {
|
||||
delete_to_trash = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
22
nixvim/config/options.nix
Normal file
22
nixvim/config/options.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
opts = {
|
||||
number = true;
|
||||
};
|
||||
|
||||
globals.mapleader = " ";
|
||||
|
||||
performance.byteCompileLua = {
|
||||
enable = true;
|
||||
nvimRuntime = true;
|
||||
plugins = true;
|
||||
};
|
||||
|
||||
performance.combinePlugins = {
|
||||
enable = true;
|
||||
standalonePlugins = [
|
||||
"hmts.nvim"
|
||||
"nvim-treesitter"
|
||||
"vimplugin-treesitter-grammar-nix"
|
||||
];
|
||||
};
|
||||
}
|
||||
82
nixvim/config/telescope.nix
Normal file
82
nixvim/config/telescope.nix
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
plugins.telescope = {
|
||||
enable = true;
|
||||
extensions.file-browser = {
|
||||
enable = true;
|
||||
# explanation: see :help expand
|
||||
# % is current file path, :p is full, :h is head (last component removed)
|
||||
settings.cwd.__raw = "'%:p:h'";
|
||||
};
|
||||
settings.defaults.mappings = {
|
||||
i = {
|
||||
# close telescope when escape pressed in insert mode
|
||||
"<esc>" = "close";
|
||||
};
|
||||
};
|
||||
keymaps = {
|
||||
# files
|
||||
"<leader><space>" = {
|
||||
action = "find_files";
|
||||
options = {
|
||||
desc = "Find files in current directory";
|
||||
};
|
||||
};
|
||||
"<leader>ff" = {
|
||||
action = "file_browser";
|
||||
options = {
|
||||
desc = "Find files in current directory";
|
||||
};
|
||||
};
|
||||
"<leader>fr" = {
|
||||
action = "oldfiles";
|
||||
options = {
|
||||
desc = "Recent files";
|
||||
};
|
||||
};
|
||||
|
||||
# search
|
||||
"<leader>/" = {
|
||||
action = "live_grep";
|
||||
options = {
|
||||
desc = "Grep (root dir)";
|
||||
};
|
||||
};
|
||||
|
||||
# buffers
|
||||
"<leader>b" = {
|
||||
action = "buffers";
|
||||
options = {
|
||||
desc = "Buffer list";
|
||||
};
|
||||
};
|
||||
|
||||
# lsp
|
||||
"<leader>sD" = {
|
||||
action = "diagnostics";
|
||||
options = {
|
||||
desc = "Workspace diagnostics";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
extraPlugins = [
|
||||
# frecency ranking
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "telescope-all-recent";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "prochri";
|
||||
repo = "telescope-all-recent.nvim";
|
||||
rev = "267e9e5fd13a6e9a4cc6ffe00452d446d040401d";
|
||||
hash = "sha256-EYU7HazKcABAGnJ3iqGqM2n+XTo64L1uqoopL/XuLFg=";
|
||||
};
|
||||
})
|
||||
# dependency for telescope-all-recent: sqlite
|
||||
pkgs.vimPlugins.sqlite-lua
|
||||
];
|
||||
extraConfigLua = (builtins.readFile ./extra_config.lua);
|
||||
# use telescope in more places
|
||||
plugins.dressing = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
1
nixvim/config/test.lua
Normal file
1
nixvim/config/test.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require('telescope').find_files()
|
||||
8
nixvim/config/toggleterm.nix
Normal file
8
nixvim/config/toggleterm.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
plugins.toggleterm = {
|
||||
enable = true;
|
||||
settings = {
|
||||
open_mapping = "[[<c-t>]]";
|
||||
};
|
||||
};
|
||||
}
|
||||
5
nixvim/config/treesitter.nix
Normal file
5
nixvim/config/treesitter.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
plugins.treesitter = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
3
nixvim/config/which-key.nix
Normal file
3
nixvim/config/which-key.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
plugins.which-key.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue