diff options
| author | leiyu3 <s444814187@gmail.com> | 2026-02-24 15:26:45 -0500 |
|---|---|---|
| committer | leiyu3 <s444814187@gmail.com> | 2026-02-24 15:26:45 -0500 |
| commit | 25bc82f7acde5fe11ee41ed3530607c219083d9a (patch) | |
| tree | 2267899fa85ead83e8cbc14a53621540c6d70d28 /.config | |
| parent | b8fcc11c9b7f77b88e0880ececa735536d938f8d (diff) | |
| download | dotfiles-master.tar.gz dotfiles-master.zip | |
Diffstat (limited to '.config')
| -rw-r--r-- | .config/foot/foot.ini | 288 | ||||
| -rw-r--r-- | .config/nvim/init.lua | 221 | ||||
| -rw-r--r-- | .config/nvim/lazy-lock.json | 16 | ||||
| -rw-r--r-- | .config/nvim/lua/config/lazy.lua | 35 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/cmp-hledger.lua | 3 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/cmp-nvim-lsp.lua | 3 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/lualine.lua | 4 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/mason-lspconfig.lua | 11 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/mason.lua | 4 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/nvim-cmp.lua | 3 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/nvim-lspconfig.lua | 13 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/telescope.lua | 8 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/tokyonight.lua | 6 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/tree-sitter.lua | 5 |
14 files changed, 620 insertions, 0 deletions
diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini new file mode 100644 index 0000000..8dcaaa8 --- /dev/null +++ b/.config/foot/foot.ini | |||
| @@ -0,0 +1,288 @@ | |||
| 1 | # -*- conf -*- | ||
| 2 | |||
| 3 | # shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) | ||
| 4 | # term=foot (or xterm-256color if built with -Dterminfo=disabled) | ||
| 5 | # login-shell=no | ||
| 6 | |||
| 7 | # app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode | ||
| 8 | # title=foot | ||
| 9 | # locked-title=no | ||
| 10 | |||
| 11 | font=JetBrainsMono Nerd Font:size=16,Noto Color Emoji:size=16 | ||
| 12 | # font-bold=<bold variant of regular font> | ||
| 13 | # font-italic=<italic variant of regular font> | ||
| 14 | # font-bold-italic=<bold+italic variant of regular font> | ||
| 15 | font-size-adjustment=1 | ||
| 16 | # line-height=<font metrics> | ||
| 17 | # letter-spacing=0 | ||
| 18 | # horizontal-letter-offset=0 | ||
| 19 | # vertical-letter-offset=0 | ||
| 20 | # underline-offset=<font metrics> | ||
| 21 | # underline-thickness=<font underline thickness> | ||
| 22 | # strikeout-thickness=<font strikeout thickness> | ||
| 23 | # box-drawings-uses-font-glyphs=no | ||
| 24 | # dpi-aware=no | ||
| 25 | # gamma-correct-blending=no | ||
| 26 | |||
| 27 | # initial-color-theme=1 | ||
| 28 | # initial-window-size-pixels=700x500 # Or, | ||
| 29 | # initial-window-size-chars=<COLSxROWS> | ||
| 30 | # initial-window-mode=windowed | ||
| 31 | # pad=0x0 center-when-maximized-and-fullscreen | ||
| 32 | # resize-by-cells=yes | ||
| 33 | # resize-keep-grid=yes | ||
| 34 | # resize-delay-ms=100 | ||
| 35 | |||
| 36 | # bold-text-in-bright=no | ||
| 37 | # word-delimiters=,│`|:"'()[]{}<> | ||
| 38 | # selection-target=primary | ||
| 39 | # workers=<number of logical CPUs> | ||
| 40 | # utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux) | ||
| 41 | # utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD) | ||
| 42 | |||
| 43 | # uppercase-regex-insert=yes | ||
| 44 | |||
| 45 | [environment] | ||
| 46 | # name=value | ||
| 47 | |||
| 48 | [security] | ||
| 49 | # osc52=enabled # disabled|copy-enabled|paste-enabled|enabled | ||
| 50 | |||
| 51 | [bell] | ||
| 52 | # system=yes | ||
| 53 | # urgent=no | ||
| 54 | # notify=no | ||
| 55 | # visual=no | ||
| 56 | # command= | ||
| 57 | # command-focused=no | ||
| 58 | |||
| 59 | [desktop-notifications] | ||
| 60 | # command=notify-send --wait --app-name ${app-id} --icon ${app-id} --category ${category} --urgency ${urgency} --expire-time ${expire-time} --hint STRING:image-path:${icon} --hint BOOLEAN:suppress-sound:${muted} --hint STRING:sound-name:${sound-name} --replace-id ${replace-id} ${action-argument} --print-id -- ${title} ${body} | ||
| 61 | # command-action-argument=--action ${action-name}=${action-label} | ||
| 62 | # close="" | ||
| 63 | # inhibit-when-focused=yes | ||
| 64 | |||
| 65 | |||
| 66 | [scrollback] | ||
| 67 | # lines=1000 | ||
| 68 | # multiplier=3.0 | ||
| 69 | # indicator-position=relative | ||
| 70 | # indicator-format="" | ||
| 71 | |||
| 72 | [url] | ||
| 73 | # launch=xdg-open ${url} | ||
| 74 | # label-letters=sadfjklewcmpgh | ||
| 75 | # osc8-underline=url-mode | ||
| 76 | # regex=(((https?://|mailto:|ftp://|file:|ssh:|ssh://|git://|tel:|magnet:|ipfs://|ipns://|gemini://|gopher://|news:)|www\.)([0-9a-zA-Z:/?#@!$&*+,;=.~_%^\-]+|\([]\["0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*\)|\[[\(\)"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*\]|"[]\[\(\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*"|'[]\[\(\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\-]*')+([0-9a-zA-Z/#@$&*+=~_%^\-]|\([]\["0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*\)|\[[\(\)"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*\]|"[]\[\(\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\-]*"|'[]\[\(\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\-]*')) | ||
| 77 | |||
| 78 | # You can define your own regex's, by adding a section called | ||
| 79 | # 'regex:<ID>' with a 'regex' and 'launch' key. These can then be tied | ||
| 80 | # to a key-binding. See foot.ini(5) for details | ||
| 81 | |||
| 82 | # [regex:your-fancy-name] | ||
| 83 | # regex=<a POSIX-Extended Regular Expression> | ||
| 84 | # launch=<path to script or application> ${match} | ||
| 85 | # | ||
| 86 | # [key-bindings] | ||
| 87 | # regex-launch=[your-fancy-name] Control+Shift+q | ||
| 88 | # regex-copy=[your-fancy-name] Control+Alt+Shift+q | ||
| 89 | |||
| 90 | [cursor] | ||
| 91 | # style=block | ||
| 92 | # blink=no | ||
| 93 | # blink-rate=500 | ||
| 94 | # beam-thickness=1.5 | ||
| 95 | # underline-thickness=<font underline thickness> | ||
| 96 | |||
| 97 | [mouse] | ||
| 98 | hide-when-typing=no | ||
| 99 | # alternate-scroll-mode=yes | ||
| 100 | |||
| 101 | [touch] | ||
| 102 | # long-press-delay=400 | ||
| 103 | |||
| 104 | [colors] | ||
| 105 | alpha=0.9 | ||
| 106 | # alpha-mode=default # Can be `default`, `matching` or `all` | ||
| 107 | # background=242424 | ||
| 108 | # foreground=ffffff | ||
| 109 | # flash=7f7f00 | ||
| 110 | # flash-alpha=0.5 | ||
| 111 | |||
| 112 | # cursor=<inverse foreground/background> | ||
| 113 | |||
| 114 | ## Normal/regular colors (color palette 0-7) | ||
| 115 | # regular0=242424 # black | ||
| 116 | # regular1=f62b5a # red | ||
| 117 | # regular2=47b413 # green | ||
| 118 | # regular3=e3c401 # yellow | ||
| 119 | # regular4=24acd4 # blue | ||
| 120 | # regular5=f2affd # magenta | ||
| 121 | # regular6=13c299 # cyan | ||
| 122 | # regular7=e6e6e6 # white | ||
| 123 | |||
| 124 | ## Bright colors (color palette 8-15) | ||
| 125 | # bright0=616161 # bright black | ||
| 126 | # bright1=ff4d51 # bright red | ||
| 127 | # bright2=35d450 # bright green | ||
| 128 | # bright3=e9e836 # bright yellow | ||
| 129 | # bright4=5dc5f8 # bright blue | ||
| 130 | # bright5=feabf2 # bright magenta | ||
| 131 | # bright6=24dfc4 # bright cyan | ||
| 132 | # bright7=ffffff # bright white | ||
| 133 | |||
| 134 | ## dimmed colors (see foot.ini(5) man page) | ||
| 135 | # dim-blend-towards=black | ||
| 136 | # dim0=<not set> | ||
| 137 | # ... | ||
| 138 | # dim7=<not-set> | ||
| 139 | |||
| 140 | ## The remaining 256-color palette | ||
| 141 | # 16 = <256-color palette #16> | ||
| 142 | # ... | ||
| 143 | # 255 = <256-color palette #255> | ||
| 144 | |||
| 145 | ## Sixel colors | ||
| 146 | # sixel0 = 000000 | ||
| 147 | # sixel1 = 3333cc | ||
| 148 | # sixel2 = cc2121 | ||
| 149 | # sixel3 = 33cc33 | ||
| 150 | # sixel4 = cc33cc | ||
| 151 | # sixel5 = 33cccc | ||
| 152 | # sixel6 = cccc33 | ||
| 153 | # sixel7 = 878787 | ||
| 154 | # sixel8 = 424242 | ||
| 155 | # sixel9 = 545499 | ||
| 156 | # sixel10 = 994242 | ||
| 157 | # sixel11 = 549954 | ||
| 158 | # sixel12 = 995499 | ||
| 159 | # sixel13 = 549999 | ||
| 160 | # sixel14 = 999954 | ||
| 161 | # sixel15 = cccccc | ||
| 162 | |||
| 163 | ## Misc colors | ||
| 164 | # selection-foreground=<inverse foreground/background> | ||
| 165 | # selection-background=<inverse foreground/background> | ||
| 166 | # jump-labels=<regular0> <regular3> # black-on-yellow | ||
| 167 | # scrollback-indicator=<regular0> <bright4> # black-on-bright-blue | ||
| 168 | # search-box-no-match=<regular0> <regular1> # black-on-red | ||
| 169 | # search-box-match=<regular0> <regular3> # black-on-yellow | ||
| 170 | # urls=<regular3> | ||
| 171 | |||
| 172 | [colors2] | ||
| 173 | # Alternative color theme, see man page foot.ini(5) | ||
| 174 | # Same builtin defaults as [color], except for: | ||
| 175 | # dim-blend-towards=white | ||
| 176 | |||
| 177 | [csd] | ||
| 178 | # preferred=server | ||
| 179 | # size=26 | ||
| 180 | # font=<primary font> | ||
| 181 | # color=<foreground color> | ||
| 182 | # hide-when-maximized=no | ||
| 183 | # double-click-to-maximize=yes | ||
| 184 | # border-width=0 | ||
| 185 | # border-color=<csd.color> | ||
| 186 | # button-width=26 | ||
| 187 | # button-color=<background color> | ||
| 188 | # button-minimize-color=<regular4> | ||
| 189 | # button-maximize-color=<regular2> | ||
| 190 | # button-close-color=<regular1> | ||
| 191 | |||
| 192 | [key-bindings] | ||
| 193 | # scrollback-up-page=Page_Up Shift+KP_Page_Up | ||
| 194 | scrollback-up-half-page=Control+u | ||
| 195 | scrollback-up-line=Control+y | ||
| 196 | # scrollback-down-page=Page_Down Shift+KP_Page_Down | ||
| 197 | scrollback-down-half-page=Control+d | ||
| 198 | scrollback-down-line=Control+e | ||
| 199 | # scrollback-home=none | ||
| 200 | # scrollback-end=none | ||
| 201 | # clipboard-copy=Control+Shift+c XF86Copy | ||
| 202 | # clipboard-paste=Control+Shift+v XF86Paste | ||
| 203 | # primary-paste=Shift+Insert | ||
| 204 | # search-start=Control+Shift+r | ||
| 205 | # font-increase=Control+plus Control+equal Control+KP_Add | ||
| 206 | # font-decrease=Control+minus Control+KP_Subtract | ||
| 207 | # font-reset=Control+0 Control+KP_0 | ||
| 208 | # spawn-terminal=Control+Shift+n | ||
| 209 | # minimize=none | ||
| 210 | # maximize=none | ||
| 211 | # fullscreen=none | ||
| 212 | # pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none | ||
| 213 | # pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none | ||
| 214 | # pipe-selected=[xargs -r firefox] none | ||
| 215 | # pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard | ||
| 216 | # show-urls-launch=Control+Shift+o | ||
| 217 | # show-urls-copy=none | ||
| 218 | # show-urls-persistent=none | ||
| 219 | # prompt-prev=Control+Shift+z | ||
| 220 | # prompt-next=Control+Shift+x | ||
| 221 | # unicode-input=Control+Shift+u | ||
| 222 | # color-theme-switch-1=none | ||
| 223 | # color-theme-switch-2=none | ||
| 224 | # color-theme-toggle=none | ||
| 225 | # noop=none | ||
| 226 | # quit=none | ||
| 227 | |||
| 228 | [search-bindings] | ||
| 229 | # cancel=Control+g Control+c Escape | ||
| 230 | # commit=Return KP_Enter | ||
| 231 | find-prev=Control+p | ||
| 232 | find-next=Control+n | ||
| 233 | # cursor-left=Left Control+b | ||
| 234 | # cursor-left-word=Control+Left Mod1+b | ||
| 235 | # cursor-right=Right Control+f | ||
| 236 | # cursor-right-word=Control+Right Mod1+f | ||
| 237 | # cursor-home=Home Control+a | ||
| 238 | # cursor-end=End Control+e | ||
| 239 | # delete-prev=BackSpace | ||
| 240 | # delete-prev-word=Mod1+BackSpace Control+BackSpace | ||
| 241 | # delete-next=Delete | ||
| 242 | # delete-next-word=Mod1+d Control+Delete | ||
| 243 | # delete-to-start=Control+u | ||
| 244 | # delete-to-end=Control+k | ||
| 245 | # extend-char=Shift+Right | ||
| 246 | # extend-to-word-boundary=Control+w Control+Shift+Right | ||
| 247 | # extend-to-next-whitespace=Control+Shift+w | ||
| 248 | # extend-line-down=Shift+Down | ||
| 249 | # extend-backward-char=Shift+Left | ||
| 250 | # extend-backward-to-word-boundary=Control+Shift+Left | ||
| 251 | # extend-backward-to-next-whitespace=none | ||
| 252 | # extend-line-up=Shift+Up | ||
| 253 | # clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste | ||
| 254 | # primary-paste=Shift+Insert | ||
| 255 | # unicode-input=none | ||
| 256 | # scrollback-up-page=Shift+Page_Up Shift+KP_Page_Up | ||
| 257 | # scrollback-up-half-page=none | ||
| 258 | # scrollback-up-line=none | ||
| 259 | # scrollback-down-page=Shift+Page_Down Shift+KP_Page_Down | ||
| 260 | # scrollback-down-half-page=none | ||
| 261 | # scrollback-down-line=none | ||
| 262 | # scrollback-home=none | ||
| 263 | # scrollback-end=none | ||
| 264 | |||
| 265 | [url-bindings] | ||
| 266 | # cancel=Control+g Control+c Control+d Escape | ||
| 267 | # toggle-url-visible=t | ||
| 268 | |||
| 269 | [text-bindings] | ||
| 270 | # \x03=Mod4+c # Map Super+c -> Ctrl+c | ||
| 271 | |||
| 272 | [mouse-bindings] | ||
| 273 | # scrollback-up-mouse=BTN_WHEEL_BACK | ||
| 274 | # scrollback-down-mouse=BTN_WHEEL_FORWARD | ||
| 275 | # font-increase=Control+BTN_WHEEL_BACK | ||
| 276 | # font-decrease=Control+BTN_WHEEL_FORWARD | ||
| 277 | # selection-override-modifiers=Shift | ||
| 278 | # primary-paste=BTN_MIDDLE | ||
| 279 | # select-begin=BTN_LEFT | ||
| 280 | # select-begin-block=Control+BTN_LEFT | ||
| 281 | # select-extend=BTN_RIGHT | ||
| 282 | # select-extend-character-wise=Control+BTN_RIGHT | ||
| 283 | # select-word=BTN_LEFT-2 | ||
| 284 | # select-word-whitespace=Control+BTN_LEFT-2 | ||
| 285 | # select-quote = BTN_LEFT-3 | ||
| 286 | # select-row=BTN_LEFT-4 | ||
| 287 | |||
| 288 | # vim: ft=dosini | ||
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..36ad9d3 --- /dev/null +++ b/.config/nvim/init.lua | |||
| @@ -0,0 +1,221 @@ | |||
| 1 | -- hi Normal guibg=NONE ctermbg=NONE | ||
| 2 | -- | ||
| 3 | require("config.lazy") | ||
| 4 | |||
| 5 | vim.g.mapleader = ' ' | ||
| 6 | |||
| 7 | vim.o.number = true | ||
| 8 | vim.o.relativenumber = true | ||
| 9 | vim.o.ignorecase = true | ||
| 10 | vim.o.smartcase = true | ||
| 11 | vim.o.tabstop = 2 | ||
| 12 | vim.o.shiftwidth = 2 | ||
| 13 | vim.o.expandtab = true | ||
| 14 | vim.o.scrolloff = 5 | ||
| 15 | |||
| 16 | vim.keymap.set('n', '<leader>a', ':keepjumps normal! ggVG<cr>') | ||
| 17 | |||
| 18 | vim.o.clipboard = "unnamedplus" | ||
| 19 | |||
| 20 | |||
| 21 | require("nvim-treesitter").setup{ | ||
| 22 | indent = { enable = true }, | ||
| 23 | highlight = { | ||
| 24 | enable = true, | ||
| 25 | additional_vim_regex_highlighting = false, | ||
| 26 | }, | ||
| 27 | auto_install = false, | ||
| 28 | ensure_installed = { | ||
| 29 | "bash", | ||
| 30 | "c", | ||
| 31 | "diff", | ||
| 32 | "html", | ||
| 33 | "javascript", | ||
| 34 | "json", | ||
| 35 | "lua", | ||
| 36 | "markdown", | ||
| 37 | "markdown_inline", | ||
| 38 | "python", | ||
| 39 | "toml", | ||
| 40 | "yaml", | ||
| 41 | }, | ||
| 42 | } | ||
| 43 | |||
| 44 | vim.api.nvim_create_autocmd('FileType', { | ||
| 45 | pattern = { '<filetype>' }, | ||
| 46 | callback = function() vim.treesitter.start() end, | ||
| 47 | }) | ||
| 48 | |||
| 49 | |||
| 50 | local builtin = require('telescope.builtin') | ||
| 51 | vim.keymap.set('n', '<C-p>', builtin.find_files, { desc = 'Telescope find files' }) | ||
| 52 | vim.keymap.set('n', '<leader>s', builtin.live_grep, { desc = 'Telescope live grep' }) | ||
| 53 | vim.keymap.set('n', '<leader>f', builtin.git_files, { desc = 'Telescope git files' }) | ||
| 54 | |||
| 55 | vim.cmd[[colorscheme tokyonight-night]] | ||
| 56 | |||
| 57 | require('lualine').setup { | ||
| 58 | options = { | ||
| 59 | icons_enabled = true, | ||
| 60 | theme = 'auto', | ||
| 61 | component_separators = { left = '', right = ''}, | ||
| 62 | section_separators = { left = '', right = ''}, | ||
| 63 | disabled_filetypes = { | ||
| 64 | statusline = {}, | ||
| 65 | winbar = {}, | ||
| 66 | }, | ||
| 67 | ignore_focus = {}, | ||
| 68 | always_divide_middle = true, | ||
| 69 | always_show_tabline = true, | ||
| 70 | globalstatus = false, | ||
| 71 | refresh = { | ||
| 72 | statusline = 1000, | ||
| 73 | tabline = 1000, | ||
| 74 | winbar = 1000, | ||
| 75 | refresh_time = 16, -- ~60fps | ||
| 76 | events = { | ||
| 77 | 'WinEnter', | ||
| 78 | 'BufEnter', | ||
| 79 | 'BufWritePost', | ||
| 80 | 'SessionLoadPost', | ||
| 81 | 'FileChangedShellPost', | ||
| 82 | 'VimResized', | ||
| 83 | 'Filetype', | ||
| 84 | 'CursorMoved', | ||
| 85 | 'CursorMovedI', | ||
| 86 | 'ModeChanged', | ||
| 87 | }, | ||
| 88 | } | ||
| 89 | }, | ||
| 90 | sections = { | ||
| 91 | lualine_a = {'mode'}, | ||
| 92 | lualine_b = {'branch', 'diff', 'diagnostics'}, | ||
| 93 | lualine_c = {'filename'}, | ||
| 94 | lualine_x = {'encoding', 'fileformat', 'filetype'}, | ||
| 95 | lualine_y = {'progress'}, | ||
| 96 | lualine_z = {'location'} | ||
| 97 | }, | ||
| 98 | inactive_sections = { | ||
| 99 | lualine_a = {}, | ||
| 100 | lualine_b = {}, | ||
| 101 | lualine_c = {'filename'}, | ||
| 102 | lualine_x = {'location'}, | ||
| 103 | lualine_y = {}, | ||
| 104 | lualine_z = {} | ||
| 105 | }, | ||
| 106 | tabline = {}, | ||
| 107 | winbar = {}, | ||
| 108 | inactive_winbar = {}, | ||
| 109 | extensions = {} | ||
| 110 | } | ||
| 111 | |||
| 112 | -- An example nvim-lspconfig capabilities setting | ||
| 113 | |||
| 114 | vim.lsp.enable("pyright") | ||
| 115 | vim.lsp.enable("lua_ls") | ||
| 116 | vim.lsp.enable("ts_ls") | ||
| 117 | vim.lsp.enable("clangd") | ||
| 118 | |||
| 119 | vim.keymap.set('n', '<space>d', vim.diagnostic.open_float) | ||
| 120 | |||
| 121 | |||
| 122 | -- Set up nvim-cmp. | ||
| 123 | local cmp = require'cmp' | ||
| 124 | |||
| 125 | cmp.setup({ | ||
| 126 | snippet = { | ||
| 127 | -- REQUIRED - you must specify a snippet engine | ||
| 128 | expand = function(args) | ||
| 129 | -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. | ||
| 130 | -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. | ||
| 131 | -- require('snippy').expand_snippet(args.body) -- For `snippy` users. | ||
| 132 | -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. | ||
| 133 | vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) | ||
| 134 | |||
| 135 | -- For `mini.snippets` users: | ||
| 136 | -- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert | ||
| 137 | -- insert({ body = args.body }) -- Insert at cursor | ||
| 138 | -- cmp.resubscribe({ "TextChangedI", "TextChangedP" }) | ||
| 139 | -- require("cmp.config").set_onetime({ sources = {} }) | ||
| 140 | end, | ||
| 141 | }, | ||
| 142 | window = { | ||
| 143 | completion = cmp.config.window.bordered(), | ||
| 144 | documentation = cmp.config.window.bordered(), | ||
| 145 | }, | ||
| 146 | mapping = cmp.mapping.preset.insert({ | ||
| 147 | ['<C-b>'] = cmp.mapping.scroll_docs(-4), | ||
| 148 | ['<C-f>'] = cmp.mapping.scroll_docs(4), | ||
| 149 | ['<C-Space>'] = cmp.mapping.complete(), | ||
| 150 | ['<C-e>'] = cmp.mapping.abort(), | ||
| 151 | ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. | ||
| 152 | }), | ||
| 153 | sources = cmp.config.sources({ | ||
| 154 | { name = 'nvim_lsp' }, | ||
| 155 | -- { name = 'vsnip' }, -- For vsnip users. | ||
| 156 | -- { name = 'luasnip' }, -- For luasnip users. | ||
| 157 | -- { name = 'ultisnips' }, -- For ultisnips users. | ||
| 158 | -- { name = 'snippy' }, -- For snippy users. | ||
| 159 | }, { | ||
| 160 | { name = 'buffer' }, | ||
| 161 | }) | ||
| 162 | }) | ||
| 163 | |||
| 164 | -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below | ||
| 165 | -- Set configuration for specific filetype. | ||
| 166 | --[[ cmp.setup.filetype('gitcommit', { | ||
| 167 | sources = cmp.config.sources({ | ||
| 168 | { name = 'git' }, | ||
| 169 | }, { | ||
| 170 | { name = 'buffer' }, | ||
| 171 | }) | ||
| 172 | }) | ||
| 173 | require("cmp_git").setup() ]]-- | ||
| 174 | |||
| 175 | -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). | ||
| 176 | cmp.setup.cmdline({ '/', '?' }, { | ||
| 177 | mapping = cmp.mapping.preset.cmdline(), | ||
| 178 | sources = { | ||
| 179 | { name = 'buffer' } | ||
| 180 | } | ||
| 181 | }) | ||
| 182 | |||
| 183 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). | ||
| 184 | cmp.setup.cmdline(':', { | ||
| 185 | mapping = cmp.mapping.preset.cmdline(), | ||
| 186 | sources = cmp.config.sources({ | ||
| 187 | { name = 'path' } | ||
| 188 | }, { | ||
| 189 | { name = 'cmdline' } | ||
| 190 | }), | ||
| 191 | matching = { disallow_symbol_nonprefix_matching = false } | ||
| 192 | }) | ||
| 193 | |||
| 194 | -- Set up lspconfig. | ||
| 195 | local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) | ||
| 196 | -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled. | ||
| 197 | vim.lsp.config("markdown_oxide", { | ||
| 198 | -- Ensure that dynamicRegistration is enabled! This allows the LS to take into account actions like the | ||
| 199 | -- Create Unresolved File code action, resolving completions for unindexed code blocks, ... | ||
| 200 | capabilities = vim.tbl_deep_extend( | ||
| 201 | 'force', | ||
| 202 | capabilities, | ||
| 203 | { | ||
| 204 | workspace = { | ||
| 205 | didChangeWatchedFiles = { | ||
| 206 | dynamicRegistration = true, | ||
| 207 | }, | ||
| 208 | }, | ||
| 209 | } | ||
| 210 | ), | ||
| 211 | on_attach = on_attach -- configure your on attach config | ||
| 212 | }) | ||
| 213 | vim.lsp.enable('markdown_oxide') | ||
| 214 | |||
| 215 | require('cmp').setup { | ||
| 216 | sources = { | ||
| 217 | { | ||
| 218 | name = 'hledger', | ||
| 219 | } | ||
| 220 | } | ||
| 221 | } | ||
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..f6a474c --- /dev/null +++ b/.config/nvim/lazy-lock.json | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | { | ||
| 2 | "cmp-hledger": { "branch": "main", "commit": "ea2211cdd4f5d171ad2bdb0d66197173ce384ddd" }, | ||
| 3 | "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, | ||
| 4 | "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, | ||
| 5 | "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, | ||
| 6 | "mason-lspconfig.nvim": { "branch": "main", "commit": "6c4830e37743b060d13c9269394176aea6a0fbc8" }, | ||
| 7 | "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, | ||
| 8 | "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, | ||
| 9 | "nvim-lspconfig": { "branch": "master", "commit": "b7dcde3e6195b43476ae799720b177aedc16d44c" }, | ||
| 10 | "nvim-treesitter": { "branch": "main", "commit": "d660b7c002f3922b6bb3da47206645488a698426" }, | ||
| 11 | "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, | ||
| 12 | "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, | ||
| 13 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, | ||
| 14 | "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, | ||
| 15 | "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" } | ||
| 16 | } | ||
diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..f5ee74c --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | -- Bootstrap lazy.nvim | ||
| 2 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
| 3 | if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||
| 4 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" | ||
| 5 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) | ||
| 6 | if vim.v.shell_error ~= 0 then | ||
| 7 | vim.api.nvim_echo({ | ||
| 8 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, | ||
| 9 | { out, "WarningMsg" }, | ||
| 10 | { "\nPress any key to exit..." }, | ||
| 11 | }, true, {}) | ||
| 12 | vim.fn.getchar() | ||
| 13 | os.exit(1) | ||
| 14 | end | ||
| 15 | end | ||
| 16 | vim.opt.rtp:prepend(lazypath) | ||
| 17 | |||
| 18 | -- Make sure to setup `mapleader` and `maplocalleader` before | ||
| 19 | -- loading lazy.nvim so that mappings are correct. | ||
| 20 | -- This is also a good place to setup other settings (vim.opt) | ||
| 21 | vim.g.mapleader = " " | ||
| 22 | vim.g.maplocalleader = "\\" | ||
| 23 | |||
| 24 | -- Setup lazy.nvim | ||
| 25 | require("lazy").setup({ | ||
| 26 | spec = { | ||
| 27 | -- import your plugins | ||
| 28 | { import = "plugins" }, | ||
| 29 | }, | ||
| 30 | -- Configure any other settings here. See the documentation for more details. | ||
| 31 | -- colorscheme that will be used when installing plugins. | ||
| 32 | install = { colorscheme = { "habamax" } }, | ||
| 33 | -- automatically check for plugin updates | ||
| 34 | checker = { enabled = true }, | ||
| 35 | }) | ||
diff --git a/.config/nvim/lua/plugins/cmp-hledger.lua b/.config/nvim/lua/plugins/cmp-hledger.lua new file mode 100644 index 0000000..d8b406d --- /dev/null +++ b/.config/nvim/lua/plugins/cmp-hledger.lua | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | return { | ||
| 2 | 'kirasok/cmp-hledger' | ||
| 3 | } | ||
diff --git a/.config/nvim/lua/plugins/cmp-nvim-lsp.lua b/.config/nvim/lua/plugins/cmp-nvim-lsp.lua new file mode 100644 index 0000000..cbebd75 --- /dev/null +++ b/.config/nvim/lua/plugins/cmp-nvim-lsp.lua | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | return { | ||
| 2 | 'hrsh7th/cmp-nvim-lsp' | ||
| 3 | } | ||
diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..5f69610 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | return { | ||
| 2 | 'nvim-lualine/lualine.nvim', | ||
| 3 | dependencies = { 'nvim-tree/nvim-web-devicons' } | ||
| 4 | } | ||
diff --git a/.config/nvim/lua/plugins/mason-lspconfig.lua b/.config/nvim/lua/plugins/mason-lspconfig.lua new file mode 100644 index 0000000..b5512e6 --- /dev/null +++ b/.config/nvim/lua/plugins/mason-lspconfig.lua | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | return { | ||
| 2 | "mason-org/mason-lspconfig.nvim", | ||
| 3 | opts = { | ||
| 4 | ensure_installed = { | ||
| 5 | "lua_ls", | ||
| 6 | -- "pyright", | ||
| 7 | "clangd", | ||
| 8 | -- "ts_ls", | ||
| 9 | }, | ||
| 10 | }, | ||
| 11 | } | ||
diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..0949c15 --- /dev/null +++ b/.config/nvim/lua/plugins/mason.lua | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | return { | ||
| 2 | "mason-org/mason.nvim", | ||
| 3 | opts = {}, | ||
| 4 | } | ||
diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..e9d946a --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-cmp.lua | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | return { | ||
| 2 | "hrsh7th/nvim-cmp" | ||
| 3 | } | ||
diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..2088263 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | return { | ||
| 2 | "neovim/nvim-lspconfig", | ||
| 3 | config = function() | ||
| 4 | local lspconfig = require("lspconfig") | ||
| 5 | |||
| 6 | -- lspconfig.lua_ls.setup({}) | ||
| 7 | -- lspconfig.pyright.setup({}) | ||
| 8 | -- lspconfig.ts_ls.setup({}) | ||
| 9 | -- lspconfig.rust_analyzer.setup({}) | ||
| 10 | -- lspconfig.clangd.setup({}) | ||
| 11 | -- lspconfig.markdown_oxide.setup({}) | ||
| 12 | end | ||
| 13 | } | ||
diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..fef8e18 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | return { | ||
| 2 | 'nvim-telescope/telescope.nvim', version = '*', | ||
| 3 | dependencies = { | ||
| 4 | 'nvim-lua/plenary.nvim', | ||
| 5 | -- optional but recommended | ||
| 6 | { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, | ||
| 7 | } | ||
| 8 | } | ||
diff --git a/.config/nvim/lua/plugins/tokyonight.lua b/.config/nvim/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..3e6a862 --- /dev/null +++ b/.config/nvim/lua/plugins/tokyonight.lua | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | return { | ||
| 2 | "folke/tokyonight.nvim", | ||
| 3 | lazy = false, | ||
| 4 | priority = 1000, | ||
| 5 | opts = {}, | ||
| 6 | } | ||
diff --git a/.config/nvim/lua/plugins/tree-sitter.lua b/.config/nvim/lua/plugins/tree-sitter.lua new file mode 100644 index 0000000..e78bd71 --- /dev/null +++ b/.config/nvim/lua/plugins/tree-sitter.lua | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | return { | ||
| 2 | "nvim-treesitter/nvim-treesitter", | ||
| 3 | lazy = false, | ||
| 4 | build = ":TSUpdate", | ||
| 5 | } | ||
