-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
283 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
_: { | ||
programs.nixvim.autoCmd = [ | ||
# Enable spellcheck for some filetypes | ||
{ | ||
event = "FileType"; | ||
pattern = [ | ||
"markdown" | ||
]; | ||
command = "setlocal spell spelllang=en,pt-br"; | ||
} | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
_: { | ||
programs.nixvim = { | ||
colorschemes = { | ||
rose-pine = { | ||
enable = true; | ||
settings = { | ||
styles = { | ||
italic = true; | ||
bold = true; | ||
transparency = false; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_: { | ||
programs.nixvim = { | ||
plugins = { | ||
copilot-lua = { | ||
enable = false; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
_: { | ||
imports = [ | ||
./colorscheme.nix | ||
./completion.nix | ||
./copilot.nix | ||
./harpoon.nix | ||
./lsp.nix | ||
./lualine.nix | ||
./telescope.nix | ||
./treesitter.nix | ||
]; | ||
|
||
programs.nixvim = { | ||
colorschemes.rose-pine.enable = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
_: { | ||
programs.nixvim = { | ||
plugins.harpoon = { | ||
enable = true; | ||
|
||
keymapsSilent = true; | ||
|
||
keymaps = { | ||
addFile = "<leader>a"; | ||
toggleQuickMenu = "<C-e>"; | ||
navFile = { | ||
"1" = "<C-h>"; | ||
"2" = "<C-t>"; | ||
"3" = "<C-n>"; | ||
"4" = "<C-s>"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
_: { | ||
programs.nixvim = { | ||
plugins = { | ||
lsp = { | ||
enable = true; | ||
|
||
keymaps = { | ||
silent = true; | ||
diagnostic = { | ||
# Navigate in diagnostics | ||
"<C-p>" = "goto_prev"; | ||
"<C-n>" = "goto_next"; | ||
"<C-y>" = "confirm"; | ||
"<C-space>" = "complete"; | ||
}; | ||
|
||
lspBuf = { | ||
gd = "definition"; | ||
gD = "references"; | ||
gt = "type_definition"; | ||
gi = "implementation"; | ||
K = "hover"; | ||
"<F2>" = "rename"; | ||
}; | ||
}; | ||
|
||
servers = { | ||
clangd.enable = true; | ||
lua-ls.enable = true; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
programs.nixvim.plugins.lualine = { | ||
enable = true; | ||
|
||
globalstatus = true; | ||
|
||
# +-------------------------------------------------+ | ||
# | A | B | C X | Y | Z | | ||
# +-------------------------------------------------+ | ||
sections = { | ||
lualine_a = ["mode"]; | ||
lualine_b = ["branch"]; | ||
lualine_c = ["filename" "diff"]; | ||
|
||
lualine_x = [ | ||
"diagnostics" | ||
|
||
# Show active language server | ||
{ | ||
name.__raw = '' | ||
function() | ||
local msg = "" | ||
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') | ||
local clients = vim.lsp.get_active_clients() | ||
if next(clients) == nil then | ||
return msg | ||
end | ||
for _, client in ipairs(clients) do | ||
local filetypes = client.config.filetypes | ||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then | ||
return client.name | ||
end | ||
end | ||
return msg | ||
end | ||
''; | ||
icon = ""; | ||
color.fg = "#ffffff"; | ||
} | ||
"encoding" | ||
"fileformat" | ||
"filetype" | ||
]; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
_: { | ||
programs.nixvim = { | ||
plugins.telescope = { | ||
enable = true; | ||
|
||
keymaps = { | ||
# Find files using Telescope command-line sugar. | ||
"<leader>sf" = "find_files"; | ||
"<leader>sh" = "help_tags"; | ||
"<leader>sg" = "git_files"; | ||
"<leader>sd" = "diagnostics"; | ||
"<leader><leader>" = "buffers"; | ||
|
||
# FZF like bindings | ||
#"<C-p>" = "git_files"; | ||
"<leader>s." = "oldfiles"; | ||
"<leader>s/" = "live_grep"; | ||
}; | ||
|
||
settings.defaults = { | ||
file_ignore_patterns = [ | ||
"^.git/" | ||
]; | ||
set_env.COLORTERM = "truecolor"; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
_: { | ||
programs.nixvim.plugins = { | ||
treesitter = { | ||
enable = true; | ||
|
||
nixvimInjections = true; | ||
|
||
folding = true; | ||
indent = true; | ||
}; | ||
|
||
treesitter-refactor = { | ||
enable = true; | ||
highlightDefinitions = { | ||
enable = true; | ||
# Set to false if you have an `updatetime` of ~100. | ||
clearOnCursorMove = false; | ||
}; | ||
}; | ||
|
||
hmts.enable = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
config, | ||
lib, | ||
... | ||
}: { | ||
programs.nixvim = { | ||
globals = { | ||
mapleader = " "; | ||
maplocalleader = " "; | ||
}; | ||
|
||
keymaps = let | ||
# Normal mode key mappings | ||
normal = | ||
lib.mapAttrsToList (key: action: { | ||
mode = "n"; | ||
inherit action key; | ||
}) | ||
{ | ||
# Movement modifications with Alt key | ||
"<M-k>" = ":move-2<CR>"; | ||
"<M-j>" = ":move+<CR>"; | ||
|
||
# Project view | ||
"<leader>pv" = "<cmd>Ex<CR>"; | ||
|
||
# Search and replace the word under cursor | ||
"<leader>s" = ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>"; | ||
|
||
# Movement reminders | ||
"<left>" = ''<cmd>echo "Use h to move!!"<CR>''; | ||
"<right>" = ''<cmd>echo "Use l to move!!"<CR>''; | ||
"<up>" = ''<cmd>echo "Use k to move!!"<CR>"''; | ||
"<down>" = ''<cmd>echo "Use j to move!!"<CR>"''; | ||
|
||
# Center the view on next and previous searches | ||
"<n>" = "nzzzv"; | ||
"<N>" = "Nzzzv"; | ||
|
||
# Clipboard operations | ||
"<leader>y" = "\"+y"; | ||
"<leader>Y" = "\"+Y"; | ||
|
||
# Delete without yanking | ||
"<leader>d" = "\"_d"; | ||
|
||
# Make the current file executable | ||
"<leader>x" = "<cmd>!chmod +x %<CR>"; | ||
|
||
# Disable the Q shortcut | ||
"Q" = "<nop>"; | ||
}; | ||
|
||
# Visual mode key mappings | ||
visual = | ||
lib.mapAttrsToList (key: action: { | ||
mode = "v"; | ||
inherit action key; | ||
}) | ||
{ | ||
# Indenting operations | ||
">" = ">gv"; | ||
"<" = "<gv"; | ||
"<TAB>" = ">gv"; | ||
"<S-TAB>" = "<gv"; | ||
|
||
# Clipboard operations in visual mode | ||
"<leader>y" = "\"+y"; | ||
"<leader>p" = "\"_dP"; | ||
|
||
# Move selected lines up and down | ||
"K" = ":m '<-2<CR>gv=gv"; | ||
"J" = ":m '>+1<CR>gv=gv"; | ||
}; | ||
in | ||
config.nixvim.helpers.keymaps.mkKeymaps | ||
{options.silent = true;} | ||
(normal ++ visual); | ||
}; | ||
} |