-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
37 changed files
with
2,499 additions
and
18 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
Submodule flakes
added at
1c6bfb
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ ... }: | ||
{ | ||
imports = [ | ||
./neovim | ||
./nushell | ||
./tmux | ||
|
||
|
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,61 @@ | ||
{ config, lib, inputs, pkgs, ... }: | ||
|
||
# references: | ||
# https://github.com/Ruixi-rebirth/flakes/tree/main/modules/editors/nvim | ||
# https://github.com/Chever-John/dotfiles/tree/master/nvim | ||
{ | ||
nixpkgs.config = { | ||
programs.npm.npmrc = '' | ||
prefix = ''${HOME}/.npm-global | ||
''; | ||
}; | ||
programs = { | ||
neovim = { | ||
enable = true; | ||
defaultEditor = true; | ||
viAlias = false; | ||
vimAlias = true; | ||
withPython3 = true; | ||
withNodeJs = true; | ||
extraPackages = [ | ||
]; | ||
#-- Plugins --# | ||
plugins = with pkgs.vimPlugins;[ ]; | ||
#-- --# | ||
}; | ||
}; | ||
home = { | ||
packages = with pkgs; [ | ||
#-- LSP --# | ||
nodePackages_latest.typescript | ||
nodePackages_latest.typescript-language-server | ||
nodePackages_latest.vscode-langservers-extracted | ||
nodePackages_latest.bash-language-server | ||
nil | ||
# rnix-lsp | ||
# nixd | ||
lua-language-server | ||
gopls | ||
pyright | ||
zk | ||
rust-analyzer | ||
clang-tools | ||
haskell-language-server | ||
#-- tree-sitter --# | ||
tree-sitter | ||
#-- format --# | ||
stylua | ||
black | ||
nixpkgs-fmt | ||
rustfmt | ||
beautysh | ||
nodePackages.prettier | ||
stylish-haskell | ||
#-- Debug --# | ||
lldb | ||
]; | ||
}; | ||
|
||
home.file.".config/nvim/init.lua".source = ./init.lua; | ||
home.file.".config/nvim/lua".source = ./lua; | ||
} |
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,30 @@ | ||
require("base") | ||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
if not vim.loop.fs_stat(lazypath) then | ||
vim.fn.system({ | ||
"git", | ||
"clone", | ||
"--filter=blob:none", | ||
"https://github.com/folke/lazy.nvim.git", | ||
"--branch=stable", -- latest stable release | ||
lazypath, | ||
}) | ||
end | ||
vim.opt.rtp:prepend(lazypath) | ||
local lazy_theme | ||
if os.getenv("GTK_THEME") == "Nordic" then | ||
lazy_theme = "nord" | ||
elseif os.getenv("GTK_THEME") == "Catppuccin-Frappe-Pink" then | ||
lazy_theme = "catppuccin-frappe" | ||
else | ||
lazy_theme = "catppuccin-latte" | ||
end | ||
local opts = { | ||
install = { | ||
colorscheme = { lazy_theme }, | ||
}, | ||
ui = { | ||
size = { width = 1.0, height = 1.0 }, | ||
}, | ||
} | ||
require("lazy").setup("plugins", opts) |
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 @@ | ||
--Revert to where the cursor was when the file was last closed | ||
vim.cmd([[autocmd BufReadPost * | ||
\ if line("'\"") > 1 && line("'\"") <= line("$") | | ||
\ exe "normal! g`\"" | | ||
\ endif]]) | ||
|
||
vim.cmd([[set iskeyword+=-]]) | ||
|
||
vim.cmd("set whichwrap+=<,>,[,],h,l") | ||
-- about fold | ||
vim.cmd("set foldmethod=expr") | ||
vim.cmd("set foldexpr=nvim_treesitter#foldexpr()") | ||
-- vim.cmd([[autocmd BufReadPost,FileReadPost * normal zR]]) | ||
|
||
-- set bg transparent | ||
--vim.cmd([[autocmd ColorScheme * highlight Normal guibg=NONE ctermbg=NONE]]) |
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,3 @@ | ||
require("base.autocmd") | ||
require("base.mappings") | ||
require("base.options") |
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,86 @@ | ||
local opts = { noremap = true, silent = true } | ||
local term_opts = { silent = true } | ||
local keymap = vim.api.nvim_set_keymap | ||
|
||
-- Remap space as leader key | ||
keymap("", "<Space>", "<Nop>", opts) | ||
vim.g.mapleader = " " | ||
|
||
-- Modes | ||
-- normal_mode = "n", | ||
-- insert_mode = "i", | ||
-- visual_mode = "v", | ||
-- visual_block_mode = "x", | ||
-- term_mode = "t", | ||
-- command_mode = "c", | ||
|
||
-- Better to save file & exit file -- | ||
keymap("n", "Q", ":q<CR>", opts) | ||
keymap("n", "S", ":w<CR>", opts) | ||
|
||
-- 'jk' key to exit insert mode -- | ||
keymap("i", "jk", "<Esc>", opts) | ||
|
||
-- Better window navigation -- | ||
keymap("n", "<C-h>", "<C-w>h", opts) | ||
keymap("n", "<C-j>", "<C-w>j", opts) | ||
keymap("n", "<C-k>", "<C-w>k", opts) | ||
keymap("n", "<C-l>", "<C-w>l", opts) | ||
|
||
-- Naviagate buffers -- | ||
keymap("n", "<TAB>", ":bnext<CR>", opts) | ||
keymap("n", "<S-TAB>", ":bprevious<CR>", opts) | ||
|
||
-- Stay in indent mode -- | ||
keymap("v", "<", "<gv", opts) | ||
keymap("v", ">", ">gv", opts) | ||
|
||
-- Move text up and down -- | ||
keymap("x", "J", ":move '>+1<CR>gv-gv", opts) | ||
keymap("x", "K", ":move '<-2<CR>gv-gv", opts) | ||
keymap("v", "J", ":move '>+1<CR>gv-gv", opts) | ||
keymap("v", "K", ":move '<-2<CR>gv-gv", opts) | ||
|
||
-- Better split screen -- | ||
keymap("", "s", "<Nop>", opts) | ||
keymap("n", "sl", ":set splitright<CR>:vsplit<CR>", opts) | ||
keymap("n", "sh", ":set nosplitright<CR>:vsplit<CR>", opts) | ||
keymap("n", "sk", ":set nosplitbelow<CR>:split<CR>", opts) | ||
keymap("n", "sj", ":set splitbelow<CR>:split<CR>", opts) | ||
|
||
-- Average adjustment window -- | ||
keymap("n", "<C-=>", "<C-w>=", opts) | ||
-- Swap and move windows -- | ||
keymap("n", "<Space>h", "<C-w>H", opts) | ||
keymap("n", "<Space>j", "<C-w>J", opts) | ||
keymap("n", "<Space>k", "<C-w>K", opts) | ||
keymap("n", "<Space>l", "<C-w>L", opts) | ||
|
||
-- Adjust the direction of the split screen -- | ||
keymap("n", ",", "<C-w>t<C-w>K", opts) | ||
keymap("n", ".", "<C-w>t<C-w>H", opts) | ||
|
||
-- Resize the window -- | ||
keymap("n", "<C-Down>", ":resize -2<CR>", opts) | ||
keymap("n", "<C-Up>", ":resize +2<CR>", opts) | ||
keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts) | ||
keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts) | ||
|
||
-- Better viewing of search results -- | ||
keymap("n", "<Space><CR>", ":nohlsearch<CR>", opts) | ||
keymap("n", "n", "nzz", opts) | ||
keymap("n", "N", "Nzz", opts) | ||
|
||
-- tabnew | ||
keymap("n", "<C-n>", ":tabnew<CR>", opts) | ||
-- msic -- | ||
keymap("n", "<C-u>", "5k", opts) | ||
keymap("n", "<C-d>", "5j", opts) | ||
keymap("n", "<C-.>", "$", opts) | ||
keymap("i", "<C-.>", "<ESC>$", opts) | ||
keymap("x", "<C-.>", "$", opts) | ||
keymap("v", "<C-.>", "$", opts) | ||
keymap("n", "<C-,>", "^", opts) | ||
keymap("i", "<C-,>", "<ESC>^", opts) | ||
keymap("x", "<C-,>", "^", opts) | ||
keymap("v", "<C-,>", "^", opts) |
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,32 @@ | ||
local options = { | ||
clipboard = "unnamedplus", | ||
mouse = "a", | ||
undofile = true, | ||
ignorecase = true, | ||
smartcase = true, | ||
showmode = false, | ||
showtabline = 2, | ||
smartindent = true, | ||
autoindent = true, | ||
swapfile = true, | ||
hidden = true, --default on | ||
expandtab = false, | ||
cmdheight = 1, | ||
shiftwidth = 4, --insert 4 spaces for each indentation | ||
tabstop = 4, --insert 4 spaces for a tab | ||
cursorline = false, --Highlight the line where the cursor is located | ||
cursorcolumn = false, | ||
number = true, | ||
numberwidth = 4, | ||
relativenumber = true, | ||
--[[ wrap = false, ]] | ||
scrolloff = 8, | ||
fileencodings = "utf-8,gbk", | ||
updatetime = 50, -- faster completion (4000ms default) | ||
foldenable = false, | ||
foldlevel = 99, | ||
} | ||
|
||
for k, v in pairs(options) do | ||
vim.opt[k] = v | ||
end |
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,38 @@ | ||
return { | ||
"windwp/nvim-autopairs", | ||
dependencies = { "hrsh7th/nvim-cmp" }, | ||
event = "InsertEnter", | ||
config = function() | ||
local status_ok, npairs = pcall(require, "nvim-autopairs") | ||
if not status_ok then | ||
return | ||
end | ||
|
||
npairs.setup({ | ||
check_ts = true, | ||
ts_config = { | ||
lua = { "string", "source" }, | ||
javascript = { "string", "template_string" }, | ||
java = false, | ||
}, | ||
disable_filetype = { "TelescopePrompt", "spectre_panel" }, | ||
fast_wrap = { | ||
map = "<M-e>", | ||
chars = { "{", "[", "(", '"', "'" }, | ||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), | ||
offset = 0, -- Offset from pattern match | ||
end_key = "$", | ||
keys = "qwertyuiopzxcvbnmasdfghjkl", | ||
check_comma = true, | ||
highlight = "PmenuSel", | ||
highlight_grey = "LineNr", | ||
}, | ||
}) | ||
local cmp_autopairs = require("nvim-autopairs.completion.cmp") | ||
local cmp_status_ok, cmp = pcall(require, "cmp") | ||
if not cmp_status_ok then | ||
return | ||
end | ||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })) | ||
end, | ||
} |
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,48 @@ | ||
return { | ||
"akinsho/bufferline.nvim", | ||
dependencies = { "nvim-tree/nvim-web-devicons", "glepnir/lspsaga.nvim" }, | ||
config = function() | ||
local highlights | ||
if os.getenv("GTK_THEME") == "Nordic" then | ||
highlights = require("nord").bufferline.highlights({ | ||
italic = true, | ||
bold = true, | ||
}) | ||
elseif | ||
os.getenv("GTK_THEME") == "Catppuccin-Frappe-Pink" or os.getenv("GTK_THEME") == "Catppuccin-Latte-Green" | ||
then | ||
highlights = require("catppuccin.groups.integrations.bufferline").get() | ||
end | ||
require("bufferline").setup({ | ||
highlights = highlights, | ||
options = { | ||
mode = "buffers", -- set to "tabs" to only show tabpages instead | ||
numbers = "buffer_id", | ||
--number_style = "superscript" | "subscript" | "" | { "none", "subscript" }, -- buffer_id at index 1, ordinal at index 2 | ||
close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" | ||
indicator_style = "▎", | ||
buffer_close_icon = "x", | ||
modified_icon = "●", | ||
close_icon = "", | ||
left_trunc_marker = "", | ||
right_trunc_marker = "", | ||
max_name_length = 30, | ||
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated | ||
tab_size = 21, | ||
diagnostics = false, | ||
diagnostics_update_in_insert = false, | ||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, | ||
show_buffer_icons = true, -- disable filetype icons for buffers | ||
show_buffer_close_icons = true, | ||
show_close_icon = true, | ||
show_tab_indicators = true, | ||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist | ||
-- can also be a table containing 2 custom separators | ||
-- [focused and unfocused]. eg: { '|', '|' } | ||
separator_style = { "", "" }, --"slant" | "thick" | "thin" | { 'any', 'any' }, | ||
enforce_regular_tabs = true, | ||
always_show_bufferline = true, | ||
}, | ||
}) | ||
end, | ||
} |
Oops, something went wrong.