1
0

Compare commits

...

8 Commits

Author SHA1 Message Date
paul 6748eea65e Fix font size 2026-03-28 04:50:31 +00:00
paul d40402e1d6 update init.el 2026-03-01 20:44:47 -05:00
Paul W e04f526ad2 Fix typo 2026-02-27 02:53:31 -05:00
Paul W 26ce40acef Update init.el 2026-02-27 02:37:42 -05:00
paul 4de553bdaa Add more conf. files
TODO(Paul): Cleanup alacritty stuff later
2026-01-28 02:02:05 -05:00
paul df8775f9be update nvim config 2026-01-26 18:16:52 -05:00
paul 6d5e2b62cb TODO for nvim v12 2025-12-03 22:46:01 -05:00
paul d07772da67 Rm stuff 2025-11-29 10:41:56 -05:00
14 changed files with 634 additions and 962 deletions
+2
View File
@@ -0,0 +1,2 @@
set debuginfod enable on
set disassembly-flavor intel
+29
View File
@@ -0,0 +1,29 @@
[font]
size = 12
[font.normal]
family = "Iosevka"
style = "Regular"
[scrolling]
history = 10000
multiplier = 3
[selection]
save_to_clipboard = false
[terminal.shell]
program = "/usr/bin/fish"
[window]
opacity = 0.85
[window.padding]
x = 10
y = 10
[general]
import = ["/home/l/.config/alacritty/catppuccin-mocha.toml"]
[terminal]
+71
View File
@@ -0,0 +1,71 @@
[[colors.indexed_colors]]
color = "#FAB387"
index = 16
[[colors.indexed_colors]]
color = "#F5E0DC"
index = 17
[colors.bright]
black = "#585B70"
blue = "#89B4FA"
cyan = "#94E2D5"
green = "#A6E3A1"
magenta = "#F5C2E7"
red = "#F38BA8"
white = "#A6ADC8"
yellow = "#F9E2AF"
[colors.cursor]
cursor = "#F5E0DC"
text = "#1E1E2E"
[colors.dim]
black = "#45475A"
blue = "#89B4FA"
cyan = "#94E2D5"
green = "#A6E3A1"
magenta = "#F5C2E7"
red = "#F38BA8"
white = "#BAC2DE"
yellow = "#F9E2AF"
[colors.hints.end]
background = "#A6ADC8"
foreground = "#1E1E2E"
[colors.hints.start]
background = "#F9E2AF"
foreground = "#1E1E2E"
[colors.normal]
black = "#45475A"
blue = "#89B4FA"
cyan = "#94E2D5"
green = "#A6E3A1"
magenta = "#F5C2E7"
red = "#F38BA8"
white = "#BAC2DE"
yellow = "#F9E2AF"
[colors.primary]
background = "#1E1E2E"
bright_foreground = "#CDD6F4"
dim_foreground = "#CDD6F4"
foreground = "#CDD6F4"
[colors.search.focused_match]
background = "#A6E3A1"
foreground = "#1E1E2E"
[colors.search.matches]
background = "#A6ADC8"
foreground = "#1E1E2E"
[colors.selection]
background = "#F5E0DC"
text = "#1E1E2E"
[colors.vi_mode_cursor]
cursor = "#B4BEFE"
text = "#1E1E2E"
+80
View File
@@ -0,0 +1,80 @@
;;"GNU Emacs 30.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.50, cairo version 1.18.4)"
(setq-local uconf-font-name "Iosevka")
(setq custom-file (file-name-concat (file-name-directory user-init-file) "custom.el"))
(setq display-lineq-numbers-type 'relative)
(setq inhibit-startup-screen t)
(menu-bar-mode 0)
(tool-bar-mode 0)
(global-display-line-numbers-mode)
(ido-mode 1)
(ido-everywhere 1)
(fido-mode 1)
(show-paren-mode 1)
(column-number-mode 1)
(whitespace-mode 1)
(keymap-global-set "C-." 'other-window)
(keymap-global-set "C-c c" 'compile)
(keymap-global-set "C-c C-c" 'recompile)
(split-window-right)
(require 'compile)
(add-to-list
'compilation-error-regexp-alist-alist
'(paren-style
"^\\([^(\n]+\\)(\\([0-9]+\\),\\([0-9]+\\)):"
1 2 3))
(add-to-list 'compilation-error-regexp-alist 'paren-style)
(defvar xdg-cache-dir
(or (getenv "XDG_CACHE_HOME")
(expand-file-name "~/.cache")))
(setq auto-save-file-name-transforms
`((".*" ,(expand-file-name "emacs/autosaves/" xdg-cache-dir) t)))
(setq backup-directory-alist
`(("." . ,(expand-file-name "emacs/backups/" xdg-cache-dir))))
(setq lock-file-name-transforms
`((".*" ,(expand-file-name "emacs/lockfiles/" xdg-cache-dir) t)))
(dolist (dir '("autosaves" "backups" "lockfiles"))
(make-directory (expand-file-name (concat "emacs/" dir) xdg-cache-dir) t))
(use-package paredit
:ensure t
:hook ((emacs-lisp-mode
lisp-mode
clojure-mode
scheme-mode
racket-mode) . paredit-mode)
:config
(setq paredit-everywhere t))
(use-package multiple-cursors
:ensure t
:bind (("C->" . mc/mark-next-like-this)
("C-S-c C-S-c" . mc/edit-lines)
("C-<" . mc/mark-previous-like-this)
("C-c C->" . mc/mark-all-like-this)))
(use-package modus-themes
:ensure t
:config
(load-theme 'modus-vivendi-tinted t))
(set-face-attribute 'default nil :height 140)
(when (find-font (font-spec
:family uconf-font-name))
(set-face-attribute 'default nil
:font uconf-font-name))
(use-package magit
:ensure t
:bind (("C-x g" . magit-status)))
(load-file custom-file)
+173
View File
@@ -0,0 +1,173 @@
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Noto Sans 12
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
tiling_drag modifier titlebar
# start a terminal
bindsym $mod+Return exec alacritty
# i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+space exec --no-startup-id "rofi -modi drun,run -show drun"
bindsym $mod+Tab exec --no-startup-id "rofi -modi window -show window"
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+m split h
# split in vertical orientation
bindsym $mod+n split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+t floating toggle
# change focus between tiling / floating windows
bindsym $mod+t focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
}
default_border pixel 0
+74
View File
@@ -0,0 +1,74 @@
general {
colors = true
interval = 5
}
order += "cpu_usage"
order += "cpu_temperature 0"
order += "load"
order += "memory"
order += "disk /"
order += "wireless _first_"
order += "ethernet _first_"
order += "volume master"
order += "battery 0"
order += "time"
cpu_temperature 0 {
format = "%degrees °C"
}
time {
format = "%Y-%m-%d %H:%M:%S"
}
load {
format = "%1min"
}
memory {
format = "%used / %total (%percentage_used)"
}
disk "/" {
format = "%free / %total (%percentage_used)"
}
volume master {
format = "♪ %volume"
format_muted = "♪ %volume (muted)"
device = "default"
mixer = "Master"
mixer_idx = 0
}
wireless _first_ {
format_up = "%ip (%essid, %bitrate, %quality)"
format_down = ""
}
ethernet _first_ {
format_up = "%ip (%speed)"
format_down = ""
}
battery 0 {
format = "%status %percentage %remaining %emptytime"
format_down = ""
status_chr = "⚡"
status_bat = "🔋"
status_unk = "?"
status_full = "Full"
status_idle = "Idle"
path = "/sys/class/power_supply/BAT%d/uevent"
low_threshold = 10
}
cpu_usage {
format = "%usage"
max_threshold = 80
}
@@ -4,26 +4,12 @@ require 'better_escape'
.setup() .setup()
require 'Comment' require 'Comment'
.setup() .setup()
local conform = require 'conform'
conform.setup {
formatters_by_ft = {
objc = {
'clang_format',
},
go = {
'goimports', 'gopls',
}
}
}
vim.keymap.set('n', '<Leader><Leader>', vim.cmd.so) vim.keymap.set('n', '<Leader><Leader>', vim.cmd.so)
vim.keymap.set('n', '<Leader>e', ':Ex')
vim.keymap.set('n', '<Leader>w', vim.cmd.write) vim.keymap.set('n', '<Leader>w', vim.cmd.write)
vim.keymap.set('n', '<Leader>q', vim.cmd.quit) vim.keymap.set('n', '<Leader>q', vim.cmd.quit)
vim.keymap.set('n', '<Leader>b', vim.cmd.Buffers) vim.keymap.set('n', '<Leader>b', vim.cmd.Buffers)
vim.keymap.set('n', '<Leader>f', conform.format)
vim.keymap.set('n', '<Leader>F', vim.lsp.buf.format)
vim.keymap.set('n', '<Leader>r', vim.lsp.buf.rename)
vim.keymap.set('n', '<Leader>e', vim.cmd.Neotree)
vim.keymap.set('n', '<Leader>h', vim.cmd.History) vim.keymap.set('n', '<Leader>h', vim.cmd.History)
vim.keymap.set('n', '<Leader>g', vim.cmd.Rg) vim.keymap.set('n', '<Leader>g', vim.cmd.Rg)
vim.keymap.set('n', '<Leader>j', vim.cmd.FZF) vim.keymap.set('n', '<Leader>j', vim.cmd.FZF)
-115
View File
@@ -1,115 +0,0 @@
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
require 'luasnip.loaders.from_vscode'.lazy_load()
local cmp = require('cmp')
local lspkind = require('lspkind')
local luasnip = require('luasnip')
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
window = {
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<Tab>'] = cmp.mapping.confirm({ select = true }),
['<C-f>'] = cmp.mapping(function(fallback)
if luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { 'i', 's' }),
['<C-b>'] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
}),
sources = cmp.config.sources({
{ name = 'buffer', keyword_length = 3, },
{ name = 'path', keyword_length = 3 },
{ name = 'nvim_lsp', keyword_length = 1 },
{ name = 'luasnip', keyword_length = 3 },
{ name = 'ctags' },
}),
formatting = {
-- fields = { 'menu', 'abbr', 'kind' },
format = lspkind.cmp_format {
mode = 'symbol_text',
maxwidth = 64,
ellipsis_char = '...',
}
}
})
require 'mason'.setup {}
require 'mason-lspconfig'.setup {}
local lsp_config = require('lspconfig')
local lsp_defaults = lsp_config.util.default_config
lsp_defaults.capabilities = vim.tbl_deep_extend(
'force',
lsp_config.util.default_config,
require 'cmp_nvim_lsp'.default_capabilities()
)
lsp_config.lua_ls.setup {
on_init = function(client)
local path = client.workspace_folders[1].name
if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then
return
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT'
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
-- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
}
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
-- library = vim.api.nvim_get_runtime_file("", true)
}
})
end,
settings = {
Lua = {}
}
}
lsp_config.jsonls.setup {
settings = {
json = {
schemas = require('schemastore').json.schemas(),
validate = { enable = true },
},
},
}
lsp_config.html.setup {}
lsp_config.rust_analyzer.setup {}
lsp_config.clangd.setup {}
lsp_config.eslint.setup {}
lsp_config.ts_ls.setup {}
lsp_config.gopls.setup {}
lsp_config.ols.setup {}
-682
View File
@@ -1,682 +0,0 @@
require('neo-tree').setup({
sources = {
"filesystem",
"buffers",
"git_status",
"document_symbols",
},
add_blank_line_at_top = false, -- Add a blank line at the top of the tree.
auto_clean_after_session_restore = false, -- Automatically clean up broken neo-tree buffers saved in sessions
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
-- popup_border_style is for input and confirmation dialogs.
-- Configurtaion of floating window is done in the individual source sections.
-- "NC" is a special style that works well with NormalNC set
default_source = "filesystem", -- you can choose a specific source `last` here which indicates the last used source
enable_diagnostics = true,
enable_git_status = true,
enable_modified_markers = true, -- Show markers for files with unsaved changes.
enable_opened_markers = true, -- Enable tracking of opened files. Required for `components.name.highlight_opened_files`
enable_refresh_on_write = true, -- Refresh the tree when a file is written. Only used if `use_libuv_file_watcher` is false.
git_status_async = true,
-- These options are for people with VERY large git repos
git_status_async_options = {
batch_size = 1000, -- how many lines of git status results to process at a time
batch_delay = 10, -- delay in ms between batches. Spreads out the workload to let other processes run.
max_lines = 10000, -- How many lines of git status results to process. Anything after this will be dropped.
-- Anything before this will be used. The last items to be processed are the untracked files.
},
hide_root_node = false, -- Hide the root node.
retain_hidden_root_indent = false, -- IF the root node is hidden, keep the indentation anyhow.
-- This is needed if you use expanders because they render in the indent.
log_level = "info", -- "trace", "debug", "info", "warn", "error", "fatal"
log_to_file = false, -- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file
open_files_in_last_window = true, -- false = open files in top left window
open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "edgy" }, -- when opening files, do not use windows containing these filetypes or buftypes
popup_border_style = "NC", -- "double", "none", "rounded", "shadow", "single" or "solid"
resize_timer_interval = 500, -- in ms, needed for containers to redraw right aligned and faded content
-- set to -1 to disable the resize timer entirely
-- -- NOTE: this will speed up to 50 ms for 1 second following a resize
sort_case_insensitive = false, -- used when sorting files and directories in the tree
sort_function = nil, -- uses a custom function for sorting files and directories in the tree
use_popups_for_input = true, -- If false, inputs will use vim.ui.input() instead of custom floats.
use_default_mappings = true,
-- source_selector provides clickable tabs to switch between sources.
source_selector = {
winbar = true, -- toggle to show selector on winbar
statusline = true, -- toggle to show selector on statusline
show_scrolled_off_parent_node = true, -- this will replace the tabs with the parent path
-- of the top visible node when scrolled down.
sources = {
{ source = "filesystem" },
{ source = "buffers" },
{ source = "git_status" },
},
content_layout = "start", -- only with `tabs_layout` = "equal", "focus"
-- start : |/ 󰓩 bufname \/...
-- end : |/ 󰓩 bufname \/...
-- center : |/ 󰓩 bufname \/...
tabs_layout = "equal", -- start, end, center, equal, focus
-- start : |/ a \/ b \/ c \ |
-- end : | / a \/ b \/ c \|
-- center : | / a \/ b \/ c \ |
-- equal : |/ a \/ b \/ c \|
-- active : |/ focused tab \/ b \/ c \|
truncation_character = "", -- character to use when truncating the tab label
tabs_min_width = nil, -- nil | int: if int padding is added based on `content_layout`
tabs_max_width = nil, -- this will truncate text even if `text_trunc_to_fit = false`
padding = 0, -- can be int or table
-- padding = { left = 2, right = 0 },
-- separator = "▕", -- can be string or table, see below
separator = { left = "", right = "" },
-- separator = { left = "/", right = "\\", override = nil }, -- |/ a \/ b \/ c \...
-- separator = { left = "/", right = "\\", override = "right" }, -- |/ a \ b \ c \...
-- separator = { left = "/", right = "\\", override = "left" }, -- |/ a / b / c /...
-- separator = { left = "/", right = "\\", override = "active" },-- |/ a / b:active \ c \...
-- separator = "|", -- || a | b | c |...
separator_active = nil, -- set separators around the active tab. nil falls back to `source_selector.separator`
show_separator_on_edge = false,
-- true : |/ a \/ b \/ c \|
-- false : | a \/ b \/ c |
highlight_tab = "NeoTreeTabInactive",
highlight_tab_active = "NeoTreeTabActive",
highlight_background = "NeoTreeTabInactive",
highlight_separator = "NeoTreeTabSeparatorInactive",
highlight_separator_active = "NeoTreeTabSeparatorActive",
},
--
event_handlers = {
{
event = "neo_tree_popup_input_ready",
---@param args { bufnr: integer, winid: integer }
handler = function(args)
vim.cmd("stopinsert")
vim.keymap.set("i", "<esc>", vim.cmd.stopinsert, { noremap = true, buffer = args.bufnr })
end,
},
-- {
-- event = "before_render",
-- handler = function (state)
-- -- add something to the state that can be used by custom components
-- end
-- },
-- {
-- event = "file_opened",
-- handler = function(file_path)
-- --auto close
-- require("neo-tree.command").execute({ action = "close" })
-- end
-- },
-- {
-- event = "file_opened",
-- handler = function(file_path)
-- --clear search after opening a file
-- require("neo-tree.sources.filesystem").reset_search()
-- end
-- },
-- {
-- event = "file_renamed",
-- handler = function(args)
-- -- fix references to file
-- print(args.source, " renamed to ", args.destination)
-- end
-- },
-- {
-- event = "file_moved",
-- handler = function(args)
-- -- fix references to file
-- print(args.source, " moved to ", args.destination)
-- end
-- },
-- {
-- event = "neo_tree_buffer_enter",
-- handler = function()
-- vim.cmd 'highlight! Cursor blend=100'
-- end
-- },
-- {
-- event = "neo_tree_buffer_leave",
-- handler = function()
-- vim.cmd 'highlight! Cursor guibg=#5f87af blend=0'
-- end
-- },
-- {
-- event = "neo_tree_window_before_open",
-- handler = function(args)
-- print("neo_tree_window_before_open", vim.inspect(args))
-- end
-- },
-- {
-- event = "neo_tree_window_after_open",
-- handler = function(args)
-- vim.cmd("wincmd =")
-- end
-- },
-- {
-- event = "neo_tree_window_before_close",
-- handler = function(args)
-- print("neo_tree_window_before_close", vim.inspect(args))
-- end
-- },
-- {
-- event = "neo_tree_window_after_close",
-- handler = function(args)
-- vim.cmd("wincmd =")
-- end
-- }
},
default_component_configs = {
container = {
enable_character_fade = true,
width = "100%",
right_padding = 0,
},
--diagnostics = {
-- symbols = {
-- hint = "H",
-- info = "I",
-- warn = "!",
-- error = "X",
-- },
-- highlights = {
-- hint = "DiagnosticSignHint",
-- info = "DiagnosticSignInfo",
-- warn = "DiagnosticSignWarn",
-- error = "DiagnosticSignError",
-- },
--},
indent = {
indent_size = 2,
padding = 1,
-- indent guides
with_markers = true,
indent_marker = "",
last_indent_marker = "",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "󰉖",
folder_empty_open = "󰷏",
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon"
},
modified = {
symbol = "[+] ",
highlight = "NeoTreeModified",
},
name = {
trailing_slash = false,
highlight_opened_files = false, -- Requires `enable_opened_markers = true`.
-- Take values in { false (no highlight), true (only loaded),
-- "all" (both loaded and unloaded)}. For more information,
-- see the `show_unloaded` config of the `buffers` source.
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Change type
added = "", -- NOTE: you can set any of these to an empty string to not show them
deleted = "",
modified = "",
renamed = "󰁕",
-- Status type
untracked = "",
ignored = "",
unstaged = "󰄱",
staged = "",
conflict = "",
},
align = "right",
},
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
file_size = {
enabled = true,
required_width = 64, -- min width of window required to show this column
},
type = {
enabled = true,
required_width = 110, -- min width of window required to show this column
},
last_modified = {
enabled = true,
required_width = 88, -- min width of window required to show this column
},
created = {
enabled = false,
required_width = 120, -- min width of window required to show this column
},
symlink_target = {
enabled = false,
},
},
renderers = {
directory = {
{ "indent" },
{ "icon" },
{ "current_filter" },
{
"container",
content = {
{ "name", zindex = 10 },
{
"symlink_target",
zindex = 10,
highlight = "NeoTreeSymbolicLinkTarget",
},
{ "clipboard", zindex = 10 },
{ "diagnostics", errors_only = true, zindex = 20, align = "right", hide_when_expanded = true },
{ "git_status", zindex = 10, align = "right", hide_when_expanded = true },
{ "file_size", zindex = 10, align = "right" },
{ "type", zindex = 10, align = "right" },
{ "last_modified", zindex = 10, align = "right" },
{ "created", zindex = 10, align = "right" },
},
},
},
file = {
{ "indent" },
{ "icon" },
{
"container",
content = {
{
"name",
zindex = 10
},
{
"symlink_target",
zindex = 10,
highlight = "NeoTreeSymbolicLinkTarget",
},
{ "clipboard", zindex = 10 },
{ "bufnr", zindex = 10 },
{ "modified", zindex = 20, align = "right" },
{ "diagnostics", zindex = 20, align = "right" },
{ "git_status", zindex = 10, align = "right" },
{ "file_size", zindex = 10, align = "right" },
{ "type", zindex = 10, align = "right" },
{ "last_modified", zindex = 10, align = "right" },
{ "created", zindex = 10, align = "right" },
},
},
},
message = {
{ "indent", with_markers = false },
{ "name", highlight = "NeoTreeMessage" },
},
terminal = {
{ "indent" },
{ "icon" },
{ "name" },
{ "bufnr" }
}
},
nesting_rules = {},
-- Global custom commands that will be available in all sources (if not overridden in `opts[source_name].commands`)
--
-- You can then reference the custom command by adding a mapping to it:
-- globally -> `opts.window.mappings`
-- locally -> `opt[source_name].window.mappings` to make it source specific.
--
-- commands = { | window { | filesystem {
-- hello = function() | mappings = { | commands = {
-- print("Hello world") | ["<C-c>"] = "hello" | hello = function()
-- end | } | print("Hello world in filesystem")
-- } | } | end
--
-- see `:h neo-tree-custom-commands-global`
commands = {}, -- A list of functions
window = { -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
-- possible options. These can also be functions that return these options.
position = "current", -- left, right, top, bottom, float, current
width = 40, -- applies to left and right positions
height = 15, -- applies to top and bottom positions
auto_expand_width = false, -- expand the window when file exceeds the window width. does not work with position = "float"
popup = { -- settings that apply to float position only
size = {
height = "80%",
width = "50%",
},
position = "50%", -- 50% means center it
-- you can also specify border here, if you want a different setting from
-- the global popup_border_style.
},
same_level = false, -- Create and paste/move files/directories on the same level as the directory under cursor (as opposed to within the directory under cursor).
insert_as = "sibling", -- Affects how nodes get inserted into the tree during creation/pasting/moving of files if the node under the cursor is a directory:
-- "child": Insert nodes as children of the directory under cursor.
-- "sibling": Insert nodes as siblings of the directory under cursor.
-- Mappings for tree window. See `:h neo-tree-mappings` for a list of built-in commands.
-- You can also create your own commands by providing a function instead of a string.
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["<space>"] = {
"toggle_node",
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
["<2-LeftMouse>"] = "open",
["<cr>"] = "open",
["<esc>"] = "cancel", -- close preview or floating neo-tree window
["P"] = { "toggle_preview", config = { use_float = true } },
["l"] = "focus_preview",
["S"] = "open_split",
-- ["S"] = "split_with_window_picker",
["s"] = "open_vsplit",
-- ["s"] = "vsplit_with_window_picker",
["t"] = "open_tabnew",
-- ["<cr>"] = "open_drop",
-- ["t"] = "open_tab_drop",
["w"] = "open_with_window_picker",
["C"] = "close_node",
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["R"] = "refresh",
["a"] = {
"add",
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none", -- "none", "relative", "absolute"
}
},
["A"] = "add_directory", -- also accepts the config.show_path and config.insert_as options.
["d"] = "delete",
["r"] = "rename",
["y"] = "copy_to_clipboard",
["x"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["c"] = "copy", -- takes text input for destination, also accepts the config.show_path and config.insert_as options
["m"] = "move", -- takes text input for destination, also accepts the config.show_path and config.insert_as options
["e"] = "toggle_auto_expand_width",
["q"] = "close_window",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
},
},
filesystem = {
window = {
mappings = {
["H"] = "toggle_hidden",
["/"] = "fuzzy_finder",
["D"] = "fuzzy_finder_directory",
--["/"] = "filter_as_you_type", -- this was the default until v1.28
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
["f"] = "filter_on_submit",
["<C-x>"] = "clear_filter",
["<bs>"] = "navigate_up",
["."] = "set_root",
["[g"] = "prev_git_modified",
["]g"] = "next_git_modified",
["i"] = "show_file_details",
["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } },
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["og"] = { "order_by_git_status", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
},
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
["<down>"] = "move_cursor_down",
["<C-n>"] = "move_cursor_down",
["<up>"] = "move_cursor_up",
["<C-p>"] = "move_cursor_up",
},
},
async_directory_scan = "auto", -- "auto" means refreshes are async, but it's synchronous when called from the Neotree commands.
-- "always" means directory scans are always async.
-- "never" means directory scans are never async.
scan_mode = "shallow", -- "shallow": Don't scan into directories to detect possible empty directory a priori
-- "deep": Scan into directories to detect empty or grouped empty directories a priori.
bind_to_cwd = true, -- true creates a 2-way binding between vim's cwd and neo-tree's root
cwd_target = {
sidebar = "tab", -- sidebar is when position = left or right
current =
"window" -- current is when position = current
},
check_gitignore_in_search = true, -- check gitignore status for files/directories when searching
-- setting this to false will speed up searches, but gitignored
-- items won't be marked if they are visible.
-- The renderer section provides the renderers that will be used to render the tree.
-- The first level is the node type.
-- For each node type, you can specify a list of components to render.
-- Components are rendered in the order they are specified.
-- The first field in each component is the name of the function to call.
-- The rest of the fields are passed to the function as the "config" argument.
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
force_visible_in_empty_folder = false, -- when true, hidden files will be shown if the root folder is otherwise empty
show_hidden_count = true, -- when true, the number of hidden items in each folder will be shown as the last entry
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
".DS_Store",
"thumbs.db"
--"node_modules",
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json"
},
always_show = { -- remains visible even if other settings would normally hide it
--".gitignored",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
find_by_full_path_words = false, -- `false` means it only searches the tail of a path.
-- `true` will change the filter into a full path
-- search with space as an implicit ".*", so
-- `fi init`
-- will match: `./sources/filesystem/init.lua
--find_command = "fd", -- this is determined automatically, you probably don't need to set it
--find_args = { -- you can specify extra args to pass to the find command.
-- fd = {
-- "--exclude", ".git",
-- "--exclude", "node_modules"
-- }
--},
---- or use a function instead of list of strings
--find_args = function(cmd, path, search_term, args)
-- if cmd ~= "fd" then
-- return args
-- end
-- --maybe you want to force the filter to always include hidden files:
-- table.insert(args, "--hidden")
-- -- but no one ever wants to see .git files
-- table.insert(args, "--exclude")
-- table.insert(args, ".git")
-- -- or node_modules
-- table.insert(args, "--exclude")
-- table.insert(args, "node_modules")
-- --here is where it pays to use the function, you can exclude more for
-- --short search terms, or vary based on the directory
-- if string.len(search_term) < 4 and path == "/home/cseickel" then
-- table.insert(args, "--exclude")
-- table.insert(args, "Library")
-- end
-- return args
--end,
group_empty_dirs = false, -- when true, empty folders will be grouped together
search_limit = 50, -- max number of search results when using filters
follow_current_file = {
enabled = false, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current",-- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
},
buffers = {
bind_to_cwd = true,
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty directories will be grouped together
show_unloaded = false, -- When working with sessions, for example, restored but unfocused buffers
-- are mark as "unloaded". Turn this on to view these unloaded buffer.
terminals_first = false, -- when true, terminals will be listed before file buffers
window = {
mappings = {
["<bs>"] = "navigate_up",
["."] = "set_root",
["bd"] = "buffer_delete",
["i"] = "show_file_details",
["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } },
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
},
},
},
git_status = {
window = {
mappings = {
["A"] = "git_add_all",
["gu"] = "git_unstage_file",
["ga"] = "git_add_file",
["gr"] = "git_revert_file",
["gc"] = "git_commit",
["gp"] = "git_push",
["gg"] = "git_commit_and_push",
["i"] = "show_file_details",
["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } },
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
},
},
},
document_symbols = {
follow_cursor = false,
client_filters = "first",
renderers = {
root = {
{ "indent" },
{ "icon", default = "C" },
{ "name", zindex = 10 },
},
symbol = {
{ "indent", with_expanders = true },
{ "kind_icon", default = "?" },
{
"container",
content = {
{ "name", zindex = 10 },
{ "kind_name", zindex = 20, align = "right" },
}
}
},
},
window = {
mappings = {
["<cr>"] = "jump_to_symbol",
["o"] = "jump_to_symbol",
["A"] = "noop", -- also accepts the config.show_path and config.insert_as options.
["d"] = "noop",
["y"] = "noop",
["x"] = "noop",
["p"] = "noop",
["c"] = "noop",
["m"] = "noop",
["a"] = "noop",
["/"] = "filter",
["f"] = "filter_on_submit",
},
},
custom_kinds = {
-- define custom kinds here (also remember to add icon and hl group to kinds)
-- ccls
-- [252] = 'TypeAlias',
-- [253] = 'Parameter',
-- [254] = 'StaticMethod',
-- [255] = 'Macro',
},
kinds = {
Unknown = { icon = "?", hl = "" },
Root = { icon = "", hl = "NeoTreeRootName" },
File = { icon = "󰈙", hl = "Tag" },
Module = { icon = "", hl = "Exception" },
Namespace = { icon = "󰌗", hl = "Include" },
Package = { icon = "󰏖", hl = "Label" },
Class = { icon = "󰌗", hl = "Include" },
Method = { icon = "", hl = "Function" },
Property = { icon = "󰆧", hl = "@property" },
Field = { icon = "", hl = "@field" },
Constructor = { icon = "", hl = "@constructor" },
Enum = { icon = "󰒻", hl = "@number" },
Interface = { icon = "", hl = "Type" },
Function = { icon = "󰊕", hl = "Function" },
Variable = { icon = "", hl = "@variable" },
Constant = { icon = "", hl = "Constant" },
String = { icon = "󰀬", hl = "String" },
Number = { icon = "󰎠", hl = "Number" },
Boolean = { icon = "", hl = "Boolean" },
Array = { icon = "󰅪", hl = "Type" },
Object = { icon = "󰅩", hl = "Type" },
Key = { icon = "󰌋", hl = "" },
Null = { icon = "", hl = "Constant" },
EnumMember = { icon = "", hl = "Number" },
Struct = { icon = "󰌗", hl = "Type" },
Event = { icon = "", hl = "Constant" },
Operator = { icon = "󰆕", hl = "Operator" },
TypeParameter = { icon = "󰊄", hl = "Type" },
-- ccls
-- TypeAlias = { icon = ' ', hl = 'Type' },
-- Parameter = { icon = ' ', hl = '@parameter' },
-- StaticMethod = { icon = '󰠄 ', hl = 'Function' },
-- Macro = { icon = ' ', hl = 'Macro' },
}
},
example = {
renderers = {
custom = {
{ "indent" },
{ "icon", default = "C" },
{ "custom" },
{ "name" }
}
},
window = {
mappings = {
["<cr>"] = "toggle_node",
["<C-e>"] = "example_command",
["d"] = "show_debug_info",
},
},
},
})
-20
View File
@@ -1,20 +0,0 @@
require 'nvim-treesitter.configs'
.setup {
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "javascript", "typescript", "rust" },
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
require 'treesitter-context'
.setup {
enable = true,
max_lines = 0,
line_numbers = true,
min_window_height = 0,
multiline_threshold = 20,
trim_scope = 'outer',
mode = 'topline',
}
-25
View File
@@ -1,25 +0,0 @@
local alpha_dashboard = require 'alpha.themes.dashboard'
alpha_dashboard.section.buttons.val = {
alpha_dashboard.button("e", "> New file", ":ene <BAR> startinsert <CR>"),
alpha_dashboard.button("f", "> Find file", ":FZF --reverse --info=inline $HOME/Sync<CR>"),
alpha_dashboard.button("r", "> Recent", ":History<CR>"),
alpha_dashboard.button("s", "> Settings", ":e $MYVIMRC | :cd %:p:h | :split . | :q <CR>"),
alpha_dashboard.button("q", "> Quit NVIM", ":qa!<CR>"),
}
if (os.getenv('TERM_PROGRAM') == 'Apple_Terminal') then
vim.cmd.colorscheme('slate')
else
require 'monokai'
.setup()
end
require 'alpha'
.setup(alpha_dashboard.opts)
require 'lualine'
.setup({
options = {
theme = 'tokyonight'
}
})
require 'highlight-undo'
.setup()
+79 -1
View File
@@ -1,2 +1,80 @@
require('lconfig') vim.g.mapleader = ' '
vim.opt.shortmess:append('I')
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.wrap = true
vim.opt.scrolloff = 8
vim.opt.laststatus = 2
vim.opt.colorcolumn = '120'
vim.opt.signcolumn = 'no'
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.smarttab = true
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv('HOME') .. '/.vim/undodir'
vim.opt.undofile = true
vim.opt.hlsearch = true
vim.opt.incsearch = true
vim.opt.winborder = 'single'
vim.cmd.colorscheme'habamax'
vim.keymap.set('v', 'K', ':m \'<-2<CR>gv=gv')
vim.keymap.set('v', 'J', ':m \'>+1<CR>gv=gv')
vim.keymap.set('n', '<C-d>', '<C-d>zz')
vim.keymap.set('n', '<C-u>', '<C-u>zz')
vim.keymap.set('n', 'n', 'nzzzv')
vim.keymap.set('n', 'N', 'Nzzzv')
vim.diagnostic.config({
virtual_text = true,
severity_sort = true,
float = {
border = 'single',
source = 'if_many',
},
})
local Plug = vim.fn['plug#']
vim.call('plug#begin')
Plug('junegunn/fzf', { ['do'] = function() vim.call('fzf#install') end })
Plug 'junegunn/fzf.vim'
Plug 'numToStr/Comment.nvim'
Plug 'andymass/vim-matchup'
Plug 'windwp/nvim-autopairs'
Plug 'mbbill/undotree'
Plug 'max397574/better-escape.nvim'
Plug 'tzachar/highlight-undo.nvim'
Plug 'folke/which-key.nvim'
Plug 'folke/noice.nvim'
-- tpope
Plug 'tpope/vim-fugitive' -- git client
Plug 'tpope/vim-sensible' -- 'sensible' vim defaults
Plug 'tpope/vim-vinegar' -- netrw changes
vim.call('plug#end')
--[[
-- use this once nvim v12 is stable
vim.pack.add{
{ src='tpope/vim-fugitive' }, -- git client
{ src='tpope/vim-sensible' }, -- 'sensible' vim defaults
{ src='tpope/vim-vinegar' }, -- netrw changes
}
]]
-103
View File
@@ -1,103 +0,0 @@
vim.g.mapleader = ' '
vim.keymap.set('v', 'K', ':m \'<-2<CR>gv=gv')
vim.keymap.set('v', 'J', ':m \'>+1<CR>gv=gv')
vim.keymap.set('n', '<C-d>', '<C-d>zz')
vim.keymap.set('n', '<C-u>', '<C-u>zz')
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
vim.keymap.set('n', 'gd', vim.lsp.buf.definition)
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation)
vim.keymap.set('n', 'gr', vim.lsp.buf.references)
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.wrap = true
vim.opt.scrolloff = 8
vim.opt.laststatus = 2
vim.opt.colorcolumn = '80'
vim.opt.signcolumn = 'no'
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.smarttab = true
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv('HOME') .. '/.vim/undodir'
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.diagnostic.config({
virtual_text = false,
severity_sort = true,
float = {
border = 'rounded',
source = 'always',
},
})
local Plug = vim.fn['plug#']
vim.call('plug#begin')
Plug('junegunn/fzf', { ['do'] = function() vim.call('fzf#install') end })
Plug 'junegunn/fzf.vim'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-neo-tree/neo-tree.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'nvim-lualine/lualine.nvim'
Plug('nvim-treesitter/nvim-treesitter', { ['do'] = ':TSUpdate' })
Plug 'nvim-treesitter/nvim-treesitter-context'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-buffer'
Plug 'delphinus/cmp-ctags'
Plug 'onsails/lspkind.nvim'
Plug 'L3MON4D3/LuaSnip'
Plug 'saadparwaiz1/cmp_luasnip'
Plug 'rafamadriz/friendly-snippets'
Plug('williamboman/mason.nvim', { ['do'] = ':MasonUpdate' })
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'stevearc/conform.nvim'
Plug 'folke/trouble.nvim'
Plug 'b0o/schemastore.nvim'
Plug 'numToStr/Comment.nvim'
Plug 'andymass/vim-matchup'
Plug 'goolord/alpha-nvim'
Plug 'windwp/nvim-autopairs'
Plug 'mbbill/undotree'
Plug 'max397574/better-escape.nvim'
Plug 'tzachar/highlight-undo.nvim'
Plug 'folke/which-key.nvim'
Plug 'folke/tokyonight.nvim'
Plug 'tanvirtin/monokai.nvim'
Plug 'folke/noice.nvim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-sensible'
Plug 'github/copilot.vim'
vim.call('plug#end')
Executable
+124
View File
@@ -0,0 +1,124 @@
#!/usr/bin/env bash
set -euo pipefail
DRY_RUN=true
usage() {
echo "Usage: $0 [--commit|-c]"
echo " --commit, -c Apply changes (default is dry-run)"
exit 0
}
while [[ $# -gt 0 ]]; do
case "$1" in
--commit|-c) DRY_RUN=false ;;
--help|-h) usage ;;
*) echo "Unknown option: $1"; usage ;;
esac
shift
done
confirm() {
local ans
read -rp "Apply this change? [y/N] " ans </dev/tty
case "$ans" in
[Yy]|[Yy][Ee][Ss]) return 0 ;; # yes
*) return 1 ;; # anything else = no
esac
}
show_diff() {
echo "--------------------------------------------------------------------------------"
diff -ru "$1" "$2" || true
echo "--------------------------------------------------------------------------------"
}
print_file_status() {
echo "- $1: $2"
}
sync_exec() {
local SRC="$1"
local DEST="$2"
local RET="$3"
if ! $DRY_RUN; then
confirm || return
fi
local opts=(-avu)
$DRY_RUN && opts+=("--dry-run")
echo "rsync $SRC $DEST $REL"
mkdir -p "$DEST/$(dirname "$REL")"
rsync "${opts[@]}" "$SRC" "$DEST/$(dirname "$REL")"| sed 's/^/[rsync] /'
}
sync_root() {
# local NAME="$1"
local DIR_A="$2"
local DIR_B="$(realpath $(dirname "$0"))"
local PATHS
PATHS="$(cat)"
echo "$DIR_A"
while IFS= read -r REL; do
[[ -z "$REL" ]] && continue
local A="$DIR_A/$REL"
local B="$DIR_B/$REL"
if [[ -e "$A" && -e "$B" ]]; then
if diff -rq "$A" "$B" >/dev/null; then
print_file_status $REL "up-to-date"
continue
fi
if [[ "$A" -nt "$B" ]]; then
print_file_status $REL "$A is newer than $B"
echo " (old) $B"
echo " (new) $A"
show_diff "$B" "$A"
FROM="$A"
TO="$DIR_B"
else
print_file_status $REL "$B is newer than $A"
echo " (old) $A"
echo " (new) $B"
show_diff "$A" "$B"
FROM="$B"
TO="$DIR_A"
fi
sync_exec $FROM $TO $REL
elif [[ -e "$A" ]]; then
print_file_status $REL "only found in $DIR_A"
sync_exec $A $DIR_B $REL
elif [[ -e "$B" ]]; then
print_file_status $REL "only found in $DIR_B"
sync_exec $B $DIR_A $REL
else
print_file_status $REL "file doesn't exist anywhere"
fi
echo
done <<< "$PATHS"
}
sync_root xdg_config "${XDG_CONFIG_HOME:-$HOME/.config}" <<'EOF'
nvim/init.lua
nvim/after/plugin/config.lua
emacs/init.el
i3/config
i3status/config
alacritty/catppuccin-mocha.toml
alacritty/alacritty.toml
EOF
sync_root home "$HOME" <<'EOF'
.gdbinit
EOF