summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCryxtalix <fgx8p9t@protonmail.com>2025-08-21 00:28:46 +0800
committerCryxtalix <fgx8p9t@protonmail.com>2025-08-21 00:28:46 +0800
commit2ba374291cb1b21218022863a7640af91966f05b (patch)
tree203fe81e49b86616364f1463619de1a67a071df6
parenta9a10c297dfabac070dac123557d4496e4a35a6a (diff)
Update
-rw-r--r--.config/nvim/LICENSE2
-rw-r--r--.config/nvim/init.lua50
-rw-r--r--.config/nvim/lazy-lock.json6
-rw-r--r--.config/nvim/lua/plugins/file_explorer.lua28
-rw-r--r--.config/nvim/lua/plugins/marks.lua9
-rw-r--r--.config/nvim/lua/plugins/rust_analyzer.lua38
-rw-r--r--.config/nvim/lua/plugins/telescope.lua34
-rw-r--r--.config/tmux/tmux.conf91
8 files changed, 203 insertions, 55 deletions
diff --git a/.config/nvim/LICENSE b/.config/nvim/LICENSE
index f288702..5002446 100644
--- a/.config/nvim/LICENSE
+++ b/.config/nvim/LICENSE
@@ -1,6 +1,6 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
-
+fjdk
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index db40749..ac0f5b6 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -17,6 +17,30 @@ vim.opt.wildmenu = true
vim.cmd("filetype plugin on")
vim.api.nvim_set_keymap('v', '<C-c>', '"+y', { noremap = true, silent = true })
+-- Working tabs and windows
+--vim.keymap.set('n', '<leader>f', '<cmd>Neotree<CR>', { desc = 'Open Neotree' })
+--vim.keymap.set("n", '<leader>c',function()
+-- vim.cmd("Tex")
+-- vim.cmd("wincmd r")
+--end, { desc = "Open tab"})
+--vim.keymap.set("n", '<leader>v', function()
+-- vim.cmd("Vex")
+-- vim.cmd("wincmd x")
+-- vim.cmd("wincmd l")
+-- vim.cmd("enew")
+--end, { desc = "Open vertical split" })
+--vim.keymap.set("n", '<leader>h', function()
+-- vim.cmd("Sex")
+-- vim.cmd("wincmd x")
+-- vim.cmd("wincmd j")
+--end, { desc = "Open horizontal split" })
+--vim.keymap.set('n', '<C-l>', '<cmd>tabnext +<CR>', { desc = 'Switch next tab' })
+--vim.keymap.set('n', '<C-h>', '<cmd>tabnext -<CR>', { desc = 'Switch prev tab' })
+--vim.keymap.set('n', '<A-k>', '<cmd>wincmd k<CR>', { desc = 'Move cursor to window above' })
+--vim.keymap.set('n', '<A-j>', '<cmd>wincmd j<CR>', { desc = 'Move cursor to window below' })
+--vim.keymap.set('n', '<A-h>', '<cmd>wincmd h<CR>', { desc = 'Move cursor to window left' })
+--vim.keymap.set('n', '<A-l>', '<cmd>wincmd l<CR>', { desc = 'Move cursor to window right' })
+
vim.diagnostic.config({
virtual_text = false, -- Disable inline text diagnostics
signs = true, -- Keep signs in the sign column
@@ -48,4 +72,30 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
+-- Rename Tmux Window to File Opened by Neovim
+-- https://github.com/Dyslectric/neovim-tmux-window-rename
+if vim.env.TMUX ~= nil then
+ -- Define an autocommand for BufEnter and FocusGained events
+ vim.api.nvim_create_autocmd({"BufEnter", "FocusGained"}, {
+ pattern = "*",
+ callback = function()
+ local file_name = vim.fn.expand("%:t")
+ local folder_name = vim.fn.expand("%:p:h:t")
+ local tmux_command = string.format(
+ "tmux rename-window 'Nv:%s/%s'", folder_name, file_name
+ )
+ vim.fn.system(tmux_command)
+ end
+ })
+
+ -- Define an autocommand for the VimLeave event
+ vim.api.nvim_create_autocmd("VimLeave", {
+ pattern = "*",
+ callback = function()
+ local shell = vim.env.SHELL or "sh"
+ vim.fn.system("tmux set-window-option automatic-rename on")
+ end
+ })
+end
+
require("lazy").setup("plugins")
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json
index a0ecc11..877913e 100644
--- a/.config/nvim/lazy-lock.json
+++ b/.config/nvim/lazy-lock.json
@@ -5,10 +5,13 @@
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
"markdown-toc": { "branch": "main", "commit": "1454bf3b4bcb855f7df41c59dfae08cc824141a0" },
+ "marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.nvim": { "branch": "main", "commit": "44a3ab2bc6b40edeb7a76359826c9779d5c70cb5" },
+ "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
"none-ls.nvim": { "branch": "main", "commit": "af318216b744f2fe2d5afa6febb01f455ae61d6c" },
+ "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" },
"nvim-dap": { "branch": "master", "commit": "99807078c5089ed30e0547aa4b52c5867933f426" },
"nvim-dap-ui": { "branch": "master", "commit": "727c032a8f63899baccb42a1c26f27687e62fc5e" },
@@ -16,11 +19,10 @@
"nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-treesitter": { "branch": "master", "commit": "5da195ac3dfafd08d8b10756d975f0e01e1d563a" },
+ "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" },
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
"render-markdown.nvim": { "branch": "main", "commit": "ad055861d17afe058bd835e82292e14a64b51b1d" },
- "ripgrep": { "branch": "master", "commit": "d6b59feff890f038acde7d5e151995d8aec1e107" },
"rustaceanvim": { "branch": "master", "commit": "66398662c07d265b226897500ed50eafba3dffb4" },
"telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" },
- "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }
}
diff --git a/.config/nvim/lua/plugins/file_explorer.lua b/.config/nvim/lua/plugins/file_explorer.lua
new file mode 100644
index 0000000..8b27dc9
--- /dev/null
+++ b/.config/nvim/lua/plugins/file_explorer.lua
@@ -0,0 +1,28 @@
+return {
+ {
+ -- https://github.com/nvim-neo-tree/neo-tree.nvim
+ "nvim-neo-tree/neo-tree.nvim",
+ branch = "v3.x",
+ dependencies = {
+ "nvim-lua/plenary.nvim",
+ "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
+ "MunifTanjim/nui.nvim",
+ -- Optional image support for file preview: See `# Preview Mode` for more information.
+ -- {"3rd/image.nvim", opts = {}},
+ -- OR use snacks.nvim's image module:
+ -- "folke/snacks.nvim",
+ },
+ lazy = false, -- neo-tree will lazily load itself
+ opts = {
+ window = {
+ position = "float",
+ popup = {
+ size = {
+ height = "70%",
+ width = "70%",
+ },
+ },
+ },
+ },
+ }
+}
diff --git a/.config/nvim/lua/plugins/marks.lua b/.config/nvim/lua/plugins/marks.lua
new file mode 100644
index 0000000..1d452ce
--- /dev/null
+++ b/.config/nvim/lua/plugins/marks.lua
@@ -0,0 +1,9 @@
+return {
+ {
+ -- https://github.com/chentoast/marks.nvim
+ -- Makes marks visible
+ "chentoast/marks.nvim",
+ event = "VeryLazy",
+ opts = {},
+ }
+}
diff --git a/.config/nvim/lua/plugins/rust_analyzer.lua b/.config/nvim/lua/plugins/rust_analyzer.lua
new file mode 100644
index 0000000..87dc010
--- /dev/null
+++ b/.config/nvim/lua/plugins/rust_analyzer.lua
@@ -0,0 +1,38 @@
+-- https://github.com/mrcjkb/rustaceanvim
+
+return {
+ {
+ 'mrcjkb/rustaceanvim',
+ version = '^6', -- Recommended
+ lazy = false, -- This plugin is already lazy
+ config = function ()
+ vim.g.rustaceanvim = {
+ -- Plugin configuration
+ tools = {
+ },
+ -- LSP configuration
+ server = {
+ default_settings = {
+ -- rust-analyzer language server configuration
+ ['rust-analyzer'] = {
+ checkOnSave = true,
+ check = {
+ enable = true,
+ command = "clippy",
+ features = "all",
+ },
+ completion = {
+ autoimport = {
+ enable = false;
+ }
+ }
+ },
+ },
+ },
+ -- DAP configuration
+ dap = {
+ },
+ }
+ end
+ },
+}
diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua
index ed58043..e3ab856 100644
--- a/.config/nvim/lua/plugins/telescope.lua
+++ b/.config/nvim/lua/plugins/telescope.lua
@@ -1,32 +1,8 @@
--- https://github.com/nvim-telescope/telescope.nvim
return {
- {
- 'nvim-telescope/telescope.nvim',
- tag = '0.1.5',
- dependencies = {
- 'nvim-lua/plenary.nvim',
- 'BurntSushi/ripgrep'
- },
-
- config = function()
- local builtin = require("telescope.builtin")
- vim.keymap.set('n', '<leader>f', builtin.find_files, {})
- vim.keymap.set('n', '<leader>/', builtin.live_grep, {})
- end
- },
- {
- "nvim-telescope/telescope-ui-select.nvim",
- config = function()
- require("telescope").setup {
- extensions = {
- ["ui-select"] = {
- require("telescope.themes").get_dropdown {
- -- even more opts
- }
- }
- }
- }
- require("telescope").load_extension("ui-select")
- end
+ -- https://github.com/nvim-telescope/telescope.nvim
+ 'nvim-telescope/telescope.nvim',
+ tag = '0.1.8',
+ dependencies = {
+ 'nvim-lua/plenary.nvim'
}
}
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
index 42a44b4..a99f6ae 100644
--- a/.config/tmux/tmux.conf
+++ b/.config/tmux/tmux.conf
@@ -1,41 +1,86 @@
-# -g for global
-# -n to not require prefix key
-
-# Source bashrc
-set-option -g default-command $SHELL
+##############################
+########## KEYBINDS ##########
+##############################
-# Set base index to 1
-set -g base-index 1
-set-window-option -g pane-base-index 1
+#----- SYSTEM -----#
+# [Alt-space] Prefix key
+unbind C-b
+set-option -g prefix M-Space
+bind M-Space send-prefix
-# Prefix-r to reload configuration
+# [Prefix-r] Reload configuration
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded"
-# Enable mouse controls
-set -g mouse on
+#----- SESSIONS -----#
+# `tmux a` to attach session
+# [Prefix-s] Session selector
+# [Prefix-d] Detach session
-# Prefix key to Ctrl-Space
-unbind C-b
-set-option -g prefix M-Space
-bind M-Space send-prefix
+# [Prefix-S] Create new session
+bind S command-prompt -p "New Session:" "new-session -A -s '%%'"
+
+# [Prefix-K] Kill current session
+bind K confirm kill-session
+
+# [Prefix-R] Set session default filesystem location
+bind R attach-session -c '#{pane_current_path}' \; display-message "New default location set"
+
+#----- WINDOWS -----#
+# [Ctrl-c] Create new window
+
+# [Ctrl-h/l] Switch windows
+bind -n C-h previous-window
+bind -n C-l next-window
+
+# [Ctrl-Alt-h/l] Change window order
+bind -n C-M-h swap-window -t -1 \; previous-window
+bind -n C-M-l swap-window -t +1 \; next-window
-# Prefix-v/h to create panes
+#----- PANES -----#
+# [Prefix-v/h] Create new pane
bind v split-window -h
bind h split-window -v
-# Alt-arrow to switch panes
+# [Alt-h/j/k/l] to switch panes
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D
-# Ctrl-arrow to switch windows
-bind -n C-h previous-window
-bind -n C-l next-window
+###################################
+########## SYSTEM CONFIG ##########
+###################################
-# Ctrl-Shift-arrow to change window order
-bind -n C-S-h swap-window -t -1 \; previous-window
-bind -n C-S-l swap-window -t +1 \; next-window
+# Source bashrc
+set-option -g default-command $SHELL
+
+# Set base index to 1
+set -g base-index 1
+set-window-option -g pane-base-index 1
# Synchronize panes
set -s command-alias[100] 'sync=set-window-option synchronize-panes'
+
+# Enable mouse controls
+set -g mouse on
+
+####################################
+########## DISPLAY CONFIG ##########
+####################################
+
+# Status bar
+set-option -g status-right ""
+set-option -g status-position top
+
+# Set status bar colors
+set-option -g status-style "fg=white,bg=black"
+set-option -g window-status-current-style "fg=black,bg=white"
+
+###########################
+########## INDEX ##########
+###########################
+# -g for global
+# Prefix key prepends any keybinds by default
+# -n to not require prefix key
+# C - CTRL key
+# M - ALT key