init
This commit is contained in:
commit
f22207f3e2
16 changed files with 988 additions and 0 deletions
5
config/colorscheme/gruvbox.nix
Normal file
5
config/colorscheme/gruvbox.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
colorschemes.gruvbox ={
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
59
config/colorscheme/onedark.nix
Normal file
59
config/colorscheme/onedark.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
colorschemes.onedark = {
|
||||
enable = true;
|
||||
};
|
||||
extraConfigLua = ''
|
||||
----------------------------------
|
||||
-- START custom setup for onedark
|
||||
----------------------------------
|
||||
-- https://github.com/navarasu/onedark.nvim
|
||||
require('onedark').setup {
|
||||
-- Main options --
|
||||
style = 'darker', -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
|
||||
transparent = true, -- Show/hide background
|
||||
term_colors = true, -- Change terminal color as per the selected theme style
|
||||
ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden
|
||||
cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu
|
||||
|
||||
-- toggle theme style ---
|
||||
-- toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "<leader>ts"
|
||||
toggle_style_key = "<leader>ts", -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "<leader>ts"
|
||||
-- toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer', 'light'}, -- List of styles to toggle between
|
||||
toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer'}, -- List of styles to toggle between
|
||||
|
||||
-- Change code style ---
|
||||
-- Options are italic, bold, underline, none
|
||||
-- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold'
|
||||
code_style = {
|
||||
comments = 'italic',
|
||||
keywords = 'none',
|
||||
functions = 'none',
|
||||
strings = 'none',
|
||||
variables = 'none'
|
||||
},
|
||||
|
||||
-- Lualine options --
|
||||
-- lualine = {
|
||||
-- transparent = true, -- lualine center bar transparency
|
||||
-- },
|
||||
|
||||
-- Custom Highlights --
|
||||
colors = {}, -- Override default colors
|
||||
highlights = {}, -- Override highlight groups
|
||||
|
||||
-- Plugins Config --
|
||||
diagnostics = {
|
||||
darker = true, -- darker colors for diagnostic
|
||||
undercurl = true, -- use undercurl instead of underline for diagnostics
|
||||
background = true, -- use background color for virtual text
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
require('onedark').load()
|
||||
----------------------------------
|
||||
-- END custom setup for onedark
|
||||
----------------------------------
|
||||
'';
|
||||
|
||||
}
|
||||
24
config/default.nix
Normal file
24
config/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# The line beneath this is called `modeline`. See `:help modeline`
|
||||
# vim: ts=4:sts=0:sw=0:tw=78:noet
|
||||
{pkgs
|
||||
, ...}:{
|
||||
# Import all your configuration modules here
|
||||
imports = [
|
||||
./colorscheme/onedark.nix
|
||||
# ./colorscheme/gruvbox.nix
|
||||
|
||||
./sets.nix
|
||||
./keymaps.nix
|
||||
|
||||
./plugins/bufferline.nix
|
||||
./plugins/comment.nix
|
||||
./plugins/indent-blankline.nix
|
||||
./plugins/leap.nix
|
||||
./plugins/lsp/lsp.nix
|
||||
# ./plugins/lsp/conform.nix
|
||||
./plugins/lualine.nix
|
||||
./plugins/nvim-tree.nix
|
||||
./plugins/telescope.nix
|
||||
# ./plugins/none-ls/none-ls.nix
|
||||
];
|
||||
}
|
||||
21
config/keymaps.nix
Normal file
21
config/keymaps.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# The line beneath this is called `modeline`. See `:help modeline`
|
||||
# vim: ts=4:sts=0:sw=0:tw=78:noet
|
||||
{
|
||||
keymaps = [
|
||||
{
|
||||
# vim.keymap.set({ "n", "v" }, "\\y", '"+y', {noremap=true, silent=true})
|
||||
mode = [ "n" "v" ];
|
||||
key = "\\y";
|
||||
action = "\"+y";
|
||||
options = {
|
||||
silent = true;
|
||||
remap = false;
|
||||
};
|
||||
}
|
||||
];
|
||||
extraConfigLua = ''
|
||||
-- see ":help default-mapping"
|
||||
-- vim.cmd[[unmap Y]]
|
||||
vim.keymap.del( "n", "Y" )
|
||||
'';
|
||||
}
|
||||
7
config/plugins/bufferline.nix
Normal file
7
config/plugins/bufferline.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
bufferline = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
config/plugins/comment.nix
Normal file
7
config/plugins/comment.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
comment = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
config/plugins/indent-blankline.nix
Normal file
7
config/plugins/indent-blankline.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
indent-blankline = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
27
config/plugins/leap.nix
Normal file
27
config/plugins/leap.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
plugins.leap = {
|
||||
enable = true;
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
mode = [ "n" "x" "o" ];
|
||||
key = "<leader>ss";
|
||||
action = "function() require('leap').leap { } end";
|
||||
}
|
||||
{
|
||||
mode = [ "n" "x" "o" ];
|
||||
key = "<leader>sS";
|
||||
action = "<Plug>(leap-backward-to)";
|
||||
}
|
||||
{
|
||||
mode = [ "n" "x" "o" ];
|
||||
key = "<leader>sx";
|
||||
action = "<Plug>(leap-forward-till)";
|
||||
}
|
||||
{
|
||||
mode = [ "n" "x" "o" ];
|
||||
key = "<leader>sX";
|
||||
action = "<Plug>(leap-backward-till)";
|
||||
}
|
||||
];
|
||||
}
|
||||
16
config/plugins/lsp.nix.bak
Normal file
16
config/plugins/lsp.nix.bak
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
tsserver.enable = true;
|
||||
|
||||
lua-ls.enable = true;
|
||||
|
||||
rust-analyzer = {
|
||||
enable = true;
|
||||
installCargo = true;
|
||||
installRustc = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
168
config/plugins/lsp/lsp.nix
Normal file
168
config/plugins/lsp/lsp.nix
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
{
|
||||
plugins = {
|
||||
lsp-format = {
|
||||
enable = false; # Enable it if you want lsp-format integration for none-ls
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
capabilities = "offsetEncoding = 'utf-16'";
|
||||
servers = {
|
||||
clangd = {enable = true;};
|
||||
lua-ls = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace";
|
||||
};
|
||||
telemetry = {
|
||||
enabled = false;
|
||||
};
|
||||
hint = {enable = true;};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
nil_ls = {enable = true;};
|
||||
tsserver = {
|
||||
enable = false;
|
||||
filetypes = ["javascript" "javascriptreact" "typescript" "typescriptreact"];
|
||||
extraOptions = {
|
||||
settings = {
|
||||
javascript = {
|
||||
inlayHints = {
|
||||
includeInlayEnumMemberValueHints = true;
|
||||
includeInlayFunctionLikeReturnTypeHints = true;
|
||||
includeInlayFunctionParameterTypeHints = true;
|
||||
includeInlayParameterNameHints = "all";
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
|
||||
includeInlayPropertyDeclarationTypeHints = true;
|
||||
includeInlayVariableTypeHints = true;
|
||||
};
|
||||
};
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayEnumMemberValueHints = true;
|
||||
includeInlayFunctionLikeReturnTypeHints = true;
|
||||
includeInlayFunctionParameterTypeHints = true;
|
||||
includeInlayParameterNameHints = "all";
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
|
||||
includeInlayPropertyDeclarationTypeHints = true;
|
||||
includeInlayVariableTypeHints = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
eslint = {enable = true;};
|
||||
pyright = {enable = true;};
|
||||
ruff-lsp = {enable = true;};
|
||||
texlab = {enable = true;};
|
||||
|
||||
rust-analyzer = {
|
||||
enable = true;
|
||||
installCargo = true;
|
||||
installRustc = true;
|
||||
settings = {
|
||||
checkOnSave = true;
|
||||
check = {
|
||||
command = "clippy";
|
||||
};
|
||||
# inlayHints = {
|
||||
# enable = true;
|
||||
# showParameterNames = true;
|
||||
# parameterHintsPrefix = "<- ";
|
||||
# otherHintsPrefix = "=> ";
|
||||
# };
|
||||
procMacro = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
# keymaps = {
|
||||
# silent = true;
|
||||
# lspBuf = {
|
||||
# gd = {
|
||||
# action = "definition";
|
||||
# desc = "Goto Definition";
|
||||
# };
|
||||
# gr = {
|
||||
# action = "references";
|
||||
# desc = "Goto References";
|
||||
# };
|
||||
# gD = {
|
||||
# action = "declaration";
|
||||
# desc = "Goto Declaration";
|
||||
# };
|
||||
# gI = {
|
||||
# action = "implementation";
|
||||
# desc = "Goto Implementation";
|
||||
# };
|
||||
# gT = {
|
||||
# action = "type_definition";
|
||||
# desc = "Type Definition";
|
||||
# };
|
||||
# K = {
|
||||
# action = "hover";
|
||||
# desc = "Hover";
|
||||
# };
|
||||
# "<leader>cw" = {
|
||||
# action = "workspace_symbol";
|
||||
# desc = "Workspace Symbol";
|
||||
# };
|
||||
# "<leader>cr" = {
|
||||
# action = "rename";
|
||||
# desc = "Rename";
|
||||
# };
|
||||
# "<leader>ca" = {
|
||||
# action = "code_action";
|
||||
# desc = "Code Action";
|
||||
# };
|
||||
# "<C-k>" = {
|
||||
# action = "signature_help";
|
||||
# desc = "Signature Help";
|
||||
# };
|
||||
# };
|
||||
# diagnostic = {
|
||||
# "<leader>cd" = {
|
||||
# action = "open_float";
|
||||
# desc = "Line Diagnostics";
|
||||
# };
|
||||
# "[d" = {
|
||||
# action = "goto_next";
|
||||
# desc = "Next Diagnostic";
|
||||
# };
|
||||
# "]d" = {
|
||||
# action = "goto_prev";
|
||||
# desc = "Previous Diagnostic";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
};
|
||||
extraConfigLua = ''
|
||||
local _border = "rounded"
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
vim.diagnostic.config{
|
||||
float={border=_border}
|
||||
};
|
||||
|
||||
require('lspconfig.ui.windows').default_options = {
|
||||
border = _border
|
||||
}
|
||||
'';
|
||||
}
|
||||
7
config/plugins/lualine.nix
Normal file
7
config/plugins/lualine.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
lualine = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
config/plugins/nvim-tree.nix
Normal file
7
config/plugins/nvim-tree.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
nvim-tree = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
190
config/plugins/telescope.nix
Normal file
190
config/plugins/telescope.nix
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
{
|
||||
plugins.telescope = {
|
||||
enable = true;
|
||||
extensions = {
|
||||
fzf-native = {
|
||||
enable = true;
|
||||
};
|
||||
# project-nvim = {
|
||||
# enable = true;
|
||||
# };
|
||||
# ui-select = {
|
||||
# settings = {
|
||||
# specific_opts = {
|
||||
# codeactions = true;
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
undo = {
|
||||
enable = true;
|
||||
mappings = {
|
||||
i = {
|
||||
"<cr>" = "yank_additions";
|
||||
"<s-cr>" = "yank_deletions";
|
||||
"<c-cr>" = "restore";
|
||||
};
|
||||
n = {
|
||||
"y" = "yank_additions";
|
||||
"Y" = "yank_deletions";
|
||||
"u" = "restore";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
# If you'd prefer Telescope not to enter a normal-like mode when hitting escape (and instead exiting), you can map <Esc> to do so via:
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
"<esc>" = {
|
||||
__raw = ''
|
||||
function(...)
|
||||
return require("telescope.actions").close(...)
|
||||
end'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
keymaps = {
|
||||
"<leader><space>" = {
|
||||
action = "find_files, {}";
|
||||
desc = "Find project files";
|
||||
};
|
||||
"<leader>/" = {
|
||||
action = "live_grep";
|
||||
desc = "Grep (root dir)";
|
||||
};
|
||||
"<leader>:" = {
|
||||
action = "command_history, {}";
|
||||
desc = "Command History";
|
||||
};
|
||||
"<leader>b" = {
|
||||
action = "buffers, {}";
|
||||
desc = "+buffer";
|
||||
};
|
||||
"<leader>ff" = {
|
||||
action = "find_files, {}";
|
||||
desc = "Find project files";
|
||||
};
|
||||
"<leader>fr" = {
|
||||
action = "oldfiles, {}";
|
||||
desc = "Recent";
|
||||
};
|
||||
"<leader>fb" = {
|
||||
action = "buffers, {}";
|
||||
desc = "Buffers";
|
||||
};
|
||||
"<C-p>" = {
|
||||
action = "git_files, {}";
|
||||
desc = "Search git files";
|
||||
};
|
||||
"<leader>gc" = {
|
||||
action = "git_commits, {}";
|
||||
desc = "Commits";
|
||||
};
|
||||
"<leader>gs" = {
|
||||
action = "git_status, {}";
|
||||
desc = "Status";
|
||||
};
|
||||
"<leader>sa" = {
|
||||
action = "autocommands, {}";
|
||||
desc = "Auto Commands";
|
||||
};
|
||||
"<leader>sb" = {
|
||||
action = "current_buffer_fuzzy_find, {}";
|
||||
desc = "Buffer";
|
||||
};
|
||||
"<leader>sc" = {
|
||||
action = "command_history, {}";
|
||||
desc = "Command History";
|
||||
};
|
||||
"<leader>sC" = {
|
||||
action = "commands, {}";
|
||||
desc = "Commands";
|
||||
};
|
||||
"<leader>sD" = {
|
||||
action = "diagnostics, {}";
|
||||
desc = "Workspace diagnostics";
|
||||
};
|
||||
"<leader>sh" = {
|
||||
action = "help_tags, {}";
|
||||
desc = "Help pages";
|
||||
};
|
||||
"<leader>sH" = {
|
||||
action = "highlights, {}";
|
||||
desc = "Search Highlight Groups";
|
||||
};
|
||||
"<leader>sk" = {
|
||||
action = "keymaps, {}";
|
||||
desc = "Keymaps";
|
||||
};
|
||||
"<leader>sM" = {
|
||||
action = "man_pages, {}";
|
||||
desc = "Man pages";
|
||||
};
|
||||
"<leader>sm" = {
|
||||
action = "marks, {}";
|
||||
desc = "Jump to Mark";
|
||||
};
|
||||
"<leader>so" = {
|
||||
action = "vim_options, {}";
|
||||
desc = "Options";
|
||||
};
|
||||
"<leader>sR" = {
|
||||
action = "resume, {}";
|
||||
desc = "Resume";
|
||||
};
|
||||
"<leader>uC" = {
|
||||
action = "colorscheme, {}";
|
||||
desc = "Colorscheme preview";
|
||||
};
|
||||
};
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fp";
|
||||
action = "<cmd>Telescope projects<CR>";
|
||||
options = {
|
||||
desc = "Projects";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>sd";
|
||||
action = "<cmd>Telescope diagnostics bufnr=0<cr>";
|
||||
options = {
|
||||
desc = "Document diagnostics";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>st";
|
||||
action = "<cmd>TodoTelescope<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Todo (Telescope)";
|
||||
};
|
||||
}
|
||||
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "<leader>,";
|
||||
# action = "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>";
|
||||
# options = {
|
||||
# desc = "Switch Buffer";
|
||||
# };
|
||||
# }
|
||||
];
|
||||
extraConfigLua = ''
|
||||
local telescope = require('telescope')
|
||||
telescope.setup{
|
||||
pickers = {
|
||||
colorscheme = {
|
||||
enable_preview = true
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
}
|
||||
66
config/sets.nix
Normal file
66
config/sets.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# The line beneath this is called `modeline`. See `:help modeline`
|
||||
# vim: ts=4:sts=0:sw=0:tw=78:noet
|
||||
{
|
||||
options = {
|
||||
relativenumber = true;
|
||||
splitbelow = true;
|
||||
redrawtime = 5000;
|
||||
|
||||
# new split to the right
|
||||
splitright = true;
|
||||
|
||||
# show hidden characters
|
||||
list = true;
|
||||
|
||||
# don't break words on the edge
|
||||
linebreak = true;
|
||||
wrap = true;
|
||||
# length of an actual \t character:
|
||||
# https://stackoverflow.com/questions/191201/indenting-comments-to-match-code-in-vim
|
||||
smartindent = false;
|
||||
# length to use when shifting text (eg. <<, >> and == commands)
|
||||
|
||||
tabstop=4;
|
||||
shiftwidth = 0;
|
||||
|
||||
expandtab = false;
|
||||
autoindent = true;
|
||||
# Set highlight on search
|
||||
hlsearch = false;
|
||||
|
||||
# Make line numbers default
|
||||
number = true;
|
||||
|
||||
# Enable mouse mode
|
||||
mouse = "a";
|
||||
|
||||
# Sync clipboard between OS and Neovim.
|
||||
# Remove this option if you want your OS clipboard to remain independent.
|
||||
# See `:help 'clipboard'`
|
||||
# vim.o.clipboard = 'unnamedplus' -- REMOVED BY ME
|
||||
|
||||
# Enable break indent
|
||||
breakindent = true;
|
||||
|
||||
# Save undo history
|
||||
# vim.o.undofile = true -- REMOVED BY ME
|
||||
|
||||
# Case insensitive searching UNLESS /C or capital in search
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
|
||||
# Keep signcolumn on by default
|
||||
signcolumn = "yes";
|
||||
|
||||
# Decrease update time
|
||||
updatetime = 250;
|
||||
timeout = true;
|
||||
timeoutlen = 300;
|
||||
|
||||
# Set completeopt to have a better completion experience
|
||||
completeopt = "menuone,noselect";
|
||||
|
||||
# NOTE: You should make sure your terminal supports this
|
||||
termguicolors = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue