Compare commits

...

3 commits

4 changed files with 139 additions and 137 deletions

View file

@ -1,136 +1,129 @@
return { return {
{ {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
config = function() config = function()
require("lualine").setup({ require("lualine").setup({
options = { options = {
--`theme=codedark, --`theme=codedark,
component_separators = { left = "", right = "" }, component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
}, },
sections = { sections = {
lualine_a = { "mode" }, lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" }, lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { lualine_c = {
{ "filename", path = 1 }, { "filename", path = 1 },
-- Determine class/function name -- Determine class/function name
function() function()
local current_buff = vim.api.nvim_get_current_buf() local current_buff = vim.api.nvim_get_current_buf()
local current_node = vim.treesitter.get_node() local current_node = vim.treesitter.get_node()
if not current_node then if not current_node then
return "" return ""
end end
local class = nil local class = nil
local func = nil local func = nil
local expr = current_node local expr = current_node
while expr do while expr do
if expr:type() == "function_definition" then if expr:type() == "function_definition" then
func = expr func = expr
elseif expr:type() == "class_definition" then elseif expr:type() == "class_definition" then
class = expr class = expr
end end
expr = expr:parent() expr = expr:parent()
end end
if not func then if not func then
return "" return ""
end end
for child in func:iter_children() do for child in func:iter_children() do
if child:type() == "identifier" then if child:type() == "identifier" then
func = child func = child
break break
end end
end end
local func_text = vim.treesitter.get_node_text(func, current_buff) local func_text = vim.treesitter.get_node_text(func, current_buff)
if class then if class then
for child in class:iter_children() do for child in class:iter_children() do
if child:type() == "identifier" then if child:type() == "identifier" then
class = child class = child
break break
end end
end end
func_text = vim.treesitter.get_node_text(class, current_buff) .. ":" .. func_text func_text = vim.treesitter.get_node_text(class, current_buff) .. ":" .. func_text
end end
if vim.bo.filetype == "lua" then if vim.bo.filetype == "lua" then
-- Patch out invalid parsing of lua (and other?) files -- Patch out invalid parsing of lua (and other?) files
return "" return ""
end end
return func_text return func_text
end, end,
}, },
lualine_x = { "encoding", "filetype" }, lualine_x = { "encoding", "filetype" },
lualine_y = { lualine_y = {
function() function()
-- Display an active Python virtual environment if active -- Display an active Python virtual environment if active
local venv = os.getenv("VIRTUAL_ENV") local venv = os.getenv("VIRTUAL_ENV")
if venv then if venv then
return vim.fn.fnamemodify(venv, ":t") return vim.fn.fnamemodify(venv, ":t")
-- Put other useful paths here as available -- Put other useful paths here as available
else else
return "" return ""
end end
end, end,
}, },
lualine_z = { "location" }, lualine_z = { "location" },
}, },
}) })
end, end,
}, },
{ {
"romgrk/barbar.nvim", "romgrk/barbar.nvim",
tag = "v1.9.1", tag = "v1.9.1",
init = function() init = function()
vim.g.barbar_auto_setup = false vim.g.barbar_auto_setup = false
end, end,
opts = { opts = {
animation = false, animation = false,
}, },
}, },
{ {
"folke/which-key.nvim", "folke/which-key.nvim",
event = "VeryLazy", event = "VeryLazy",
keys = { keys = {
{ {
"<S-F1>", "<S-F1>",
function() function()
require("which-key").show() require("which-key").show()
end, end,
mode = { "n", "v", "i" }, mode = { "n", "v", "i" },
}, },
}, },
}, },
{ {
"preservim/tagbar", "preservim/tagbar",
vim.keymap.set("n", "<leader>fs", ":TagbarToggle<CR>", { desc = "Toggle Tagbar" }), vim.keymap.set("n", "<leader>fs", ":TagbarToggle<CR>", { desc = "Toggle Tagbar" }),
}, },
--{ {
-- "yegappan/taglist", "goolord/alpha-nvim",
-- vim.keymap.set("n", "<leader>fs", ":TlistToggle<CR>", { desc = "Toggle Taglist" }), dependencies = { "nvim-tree/nvim-web-devicons", "nvim-neo-tree/neo-tree.nvim" },
-- vim.cmd("let Tlist_Use_Right_Window = 1"), config = function()
-- vim.cmd("let Tlist_Show_One_File = 1"), local alpha = require("alpha")
-- vim.cmd("let Tlist_WinWidth = 50"), local dashboard = require("alpha.themes.startify")
--},
{
"goolord/alpha-nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.startify")
dashboard.section.header.val = { dashboard.section.header.val = {
" ", " ",
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
" ", " ",
} }
alpha.setup(dashboard.opts) alpha.setup(dashboard.opts)
end, end,
}, },
} }

View file

@ -7,15 +7,12 @@ return {
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information -- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
}, },
lazy = false, -- neo-tree will lazily load itself lazy = true, -- neo-tree will lazily load itself
opts = { opts = {
filesystem = { filesystem = {
filtered_items = { filtered_items = {
visible = true, visible = true,
-- hide_dotfiles = false, hide_gitignored = true,
hide_by_name = {
".git",
},
}, },
}, },
event_handlers = { event_handlers = {
@ -23,7 +20,7 @@ return {
event = "file_opened", event = "file_opened",
handler = function(file_path) handler = function(file_path)
--auto close neo-tree when file is opened --auto close neo-tree when file is opened
vim.cmd("Neotree close") vim.cmd("Neotree close")
end, end,
}, },
}, },

View file

@ -25,6 +25,9 @@ bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "xcli
bind S-down split-window -v -c "#{pane_current_path}" bind S-down split-window -v -c "#{pane_current_path}"
bind S-right split-window -h -c "#{pane_current_path}" bind S-right split-window -h -c "#{pane_current_path}"
bind J split-window -v -c "#{pane_current_path}"
bind L split-window -h -c "#{pane_current_path}"
# Override new window # Override new window
bind c new-window -c "~/" bind c new-window -c "~/"
@ -34,9 +37,18 @@ bind -n C-Right select-pane -R
bind -n C-Up select-pane -U bind -n C-Up select-pane -U
bind -n C-Down select-pane -D bind -n C-Down select-pane -D
bind -n C-H select-pane -L
bind -n C-J select-pane -D
bind -n C-K select-pane -U
bind -n C-L select-pane -R
bind -n C-S-Left previous-window bind -n C-S-Left previous-window
bind -n C-S-Right next-window bind -n C-S-Right next-window
bind -n M-H previous-window
bind -n M-L next-window
# Config # Config
bind R source-file ~/.config/tmux/tmux.conf \; display "Config reloaded!" bind R source-file ~/.config/tmux/tmux.conf \; display "Config reloaded!"

2
.zshrc
View file

@ -149,5 +149,5 @@ zinit light zsh-users/zsh-syntax-highlighting
# Key bindings config # Key bindings config
#KEYTIMEOUT=5 #KEYTIMEOUT=5
# ^[ for esc; ^I for tab # ^[ for esc; ^I for tab
bindkey '^[[Z' autosuggest-accept bindkey '^a' autosuggest-accept