diff --git a/gitui/theme.ron b/gitui/theme.ron new file mode 100644 index 0000000..3dcf108 --- /dev/null +++ b/gitui/theme.ron @@ -0,0 +1,24 @@ +// TokyoNight Night theme for gitui +( + selected_tab: Reset, + command_fg: Rgb(192, 202, 245), + selection_bg: Rgb(41, 46, 66), + selection_fg: Rgb(192, 202, 245), + cmdbar_bg: Rgb(26, 27, 38), + cmdbar_extra_lines_bg: Rgb(26, 27, 38), + disabled_fg: Rgb(86, 95, 137), + diff_line_add: Rgb(158, 206, 106), + diff_line_delete: Rgb(247, 118, 142), + diff_file_added: Rgb(115, 218, 202), + diff_file_removed: Rgb(247, 118, 142), + diff_file_moved: Rgb(187, 154, 247), + diff_file_modified: Rgb(224, 175, 104), + commit_hash: Rgb(187, 154, 247), + commit_time: Rgb(125, 207, 255), + commit_author: Rgb(158, 206, 106), + danger_fg: Rgb(247, 118, 142), + push_gauge_bg: Rgb(65, 72, 104), + push_gauge_fg: Rgb(192, 202, 245), + tag_fg: Rgb(187, 154, 247), + branch_fg: Rgb(224, 175, 104), +) diff --git a/nvim/disable/config.lua b/nvim/disable/config.lua deleted file mode 100644 index 9384f8c..0000000 --- a/nvim/disable/config.lua +++ /dev/null @@ -1,24 +0,0 @@ -local rocks_config = { -rocks_path = vim.env.HOME .. "/.local/share/nvim/rocks", -} - -vim.g.rocks_nvim = rocks_config - -local luarocks_path = { -vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?.lua"), -vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?", "init.lua"), -} -package.path = package.path .. ";" .. table.concat(luarocks_path, ";") - -local luarocks_cpath = { -vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.so"), -vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.so"), --- Remove the dylib and dll paths if you do not need macos or windows support -vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dylib"), -vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dylib"), -vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dll"), -vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dll"), -} -package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";") - -vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*")) diff --git a/nvim/disable/config.vim b/nvim/disable/config.vim deleted file mode 100644 index 90bbfb6..0000000 --- a/nvim/disable/config.vim +++ /dev/null @@ -1,355 +0,0 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => General -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -set mouse=a -" Sets how many lines of history VIM has to remember -set history=500 - -" Enable filetype plugins -filetype plugin on -filetype indent on - -" Set to auto read when a file is changed from the outside -set autoread -au FocusGained,BufEnter * checktime - -" With a map leader it's possible to do extra key combinations -" like w saves the current file -let mapleader = "," - -" Fast saving -nmap s :w! - -" :W sudo saves the file -" (useful for handling the permission-denied error) -command! W execute 'w !sudo tee % > /dev/null' edit! - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => VIM user interface -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Set 7 lines to the cursor - when moving vertically using j/k -set so=7 - -" Avoid garbled characters in Chinese language windows OS -let $LANG='en' -set langmenu=en -source $VIMRUNTIME/delmenu.vim -source $VIMRUNTIME/menu.vim - -" Turn on the Wild menu -set wildmenu - -" Ignore compiled files -set wildignore=*.o,*~,*.pyc -if has("win16") || has("win32") - set wildignore+=.git\*,.hg\*,.svn\* -else - set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store -endif - -"Always show current position -set ruler - -" Height of the command bar -set cmdheight=1 - -" A buffer becomes hidden when it is abandoned -set hid - -" Configure backspace so it acts as it should act -set backspace=eol,start,indent -set whichwrap+=<,>,h,l - -" Ignore case when searching -set ignorecase - -" When searching try to be smart about cases -set smartcase - -" Highlight search results -set hlsearch - -" Makes search act like search in modern browsers -set incsearch - -" Don't redraw while executing macros (good performance config) -set lazyredraw - -" For regular expressions turn magic on -set magic - -" Show matching brackets when text indicator is over them -set showmatch -" How many tenths of a second to blink when matching brackets -set mat=2 - -" No annoying sound on errors -set noerrorbells -set novisualbell -set t_vb= -set tm=500 - -" Properly disable sound on errors on MacVim -if has("gui_macvim") - autocmd GUIEnter * set vb t_vb= -endif - - -" Add a bit extra margin to the left -set foldcolumn=1 - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Colors and Fonts -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Enable syntax highlighting -syntax enable - -" Enable 256 colors palette in Gnome Terminal -if $COLORTERM == 'gnome-terminal' - set t_Co=256 -endif - -try - colorscheme darkelf -catch -endtry - -set background=dark - -" Set extra options when running in GUI mode -if has("gui_running") - set guioptions-=T - set guioptions-=e - set t_Co=256 - set guitablabel=%M\ %t -endif - -" Set utf8 as standard encoding and en_US as the standard language -set encoding=utf8 - -" Use Unix as the standard file type -set ffs=unix,dos,mac - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Files, backups and undo -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Turn backup off, since most stuff is in SVN, git etc. anyway... -set nobackup -set nowb -set noswapfile - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Text, tab and indent related -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Use spaces instead of tabs -set expandtab - -" Be smart when using tabs ;) -set smarttab - -" 1 tab == 4 spaces -set shiftwidth=4 -set tabstop=4 - -" Linebreak on 500 characters -set lbr -set tw=500 - -set ai "Auto indent -set si "Smart indent -set wrap "Wrap lines - - -"""""""""""""""""""""""""""""" -" => Visual mode related -"""""""""""""""""""""""""""""" -" Visual mode pressing * or # searches for the current selection -" Super useful! From an idea by Michael Naumann -vnoremap * :call VisualSelection('', '')/=@/ -vnoremap # :call VisualSelection('', '')?=@/ - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Moving around, tabs, windows and buffers -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Map to / (search) and Ctrl- to ? (backwards search) -"map / -"map ? - -" Disable highlight when is pressed -map :noh - -" Smart way to move between windows -map j -map k -map h -map l - -" Close the current buffer -map bd :Bclose:tabclosegT - -" Close all the buffers -map ba :bufdo bd - -map bl :bnext -map bh :bprevious - -" Useful mappings for managing tabs -map tn :tabnew -map to :tabonly -map tc :tabclose -map tm :tabmove -map t :tabnext - -" Let 'tl' toggle between this and the last accessed tab -let g:lasttab = 1 -nmap tl :exe "tabn ".g:lasttab -au TabLeave * let g:lasttab = tabpagenr() - - -" Opens a new tab with the current buffer's path -" Super useful when editing files in the same directory -map te :tabedit =expand("%:p:h")/ - -" Switch CWD to the directory of the open buffer -map cd :cd %:p:h:pwd - -" Specify the behavior when switching between buffers -try - set switchbuf=useopen,usetab,newtab - set stal=2 -catch -endtry - -" Return to last edit position when opening files (You want this!) -au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif - - -"""""""""""""""""""""""""""""" -" => Status line -"""""""""""""""""""""""""""""" -" Always show the status line -set laststatus=2 - -" Format the status line -set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Editing mappings -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Remap VIM 0 to first non-blank character -map 0 ^ - -" Move a line of text using ALT+[jk] or Command+[jk] on mac -nmap mz:m+`z -nmap mz:m-2`z -vmap :m'>+`mzgv`yo`z -vmap :m'<-2`>my` - nmap - vmap - vmap -endif - -" Delete trailing white space on save, useful for some filetypes ;) -fun! CleanExtraSpaces() - let save_cursor = getpos(".") - let old_query = getreg('/') - silent! %s/\s\+$//e - call setpos('.', save_cursor) - call setreg('/', old_query) -endfun - -if has("autocmd") - autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee :call CleanExtraSpaces() -endif - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Spell checking -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Pressing ,ss will toggle and untoggle spell checking -map ss :setlocal spell! - -" Shortcuts using -map sn ]s -map sp [s -map sa zg -map s? z= - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Misc -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Remove the Windows ^M - when the encodings gets messed up -noremap m mmHmt:%s///ge'tzt'm - -" Quickly open a buffer for scribble -map q :e ~/buffer - -" Quickly open a markdown buffer for scribble -map x :e ~/buffer.md - -" Toggle paste mode on and off -map pp :setlocal paste! - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Helper functions -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Returns true if paste mode is enabled -function! HasPaste() - if &paste - return 'PASTE MODE ' - endif - return '' -endfunction - -" Don't close window, when deleting a buffer -command! Bclose call BufcloseCloseIt() -function! BufcloseCloseIt() - let l:currentBufNum = bufnr("%") - let l:alternateBufNum = bufnr("#") - - if buflisted(l:alternateBufNum) - buffer # - else - bnext - endif - - if bufnr("%") == l:currentBufNum - new - endif - - if buflisted(l:currentBufNum) - execute("bdelete! ".l:currentBufNum) - endif -endfunction - -function! CmdLine(str) - call feedkeys(":" . a:str) -endfunction - -function! VisualSelection(direction, extra_filter) range - let l:saved_reg = @" - execute "normal! vgvy" - - let l:pattern = escape(@", "\\/.*'$^~[]") - let l:pattern = substitute(l:pattern, "\n$", "", "") - - if a:direction == 'gv' - call CmdLine("Ack '" . l:pattern . "' " ) - elseif a:direction == 'replace' - call CmdLine("%s" . '/'. l:pattern . '/') - endif - - let @/ = l:pattern - let @" = l:saved_reg -endfunction diff --git a/nvim/disable/init.vim b/nvim/disable/init.vim deleted file mode 100644 index 9ae7454..0000000 --- a/nvim/disable/init.vim +++ /dev/null @@ -1,357 +0,0 @@ -lua require('config.lazy') - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => General -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -set mouse=a -" Sets how many lines of history VIM has to remember -set history=500 - -" Enable filetype plugins -filetype plugin on -filetype indent on - -" Set to auto read when a file is changed from the outside -set autoread -au FocusGained,BufEnter * checktime - -" With a map leader it's possible to do extra key combinations -" like w saves the current file -let mapleader = "," - -" Fast saving -nmap s :w! - -" :W sudo saves the file -" (useful for handling the permission-denied error) -command! W execute 'w !sudo tee % > /dev/null' edit! - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => VIM user interface -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Set 7 lines to the cursor - when moving vertically using j/k -set so=7 - -" Avoid garbled characters in Chinese language windows OS -let $LANG='en' -set langmenu=en -source $VIMRUNTIME/delmenu.vim -source $VIMRUNTIME/menu.vim - -" Turn on the Wild menu -set wildmenu - -" Ignore compiled files -set wildignore=*.o,*~,*.pyc -if has("win16") || has("win32") - set wildignore+=.git\*,.hg\*,.svn\* -else - set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store -endif - -"Always show current position -set ruler - -" Height of the command bar -set cmdheight=1 - -" A buffer becomes hidden when it is abandoned -set hid - -" Configure backspace so it acts as it should act -set backspace=eol,start,indent -set whichwrap+=<,>,h,l - -" Ignore case when searching -set ignorecase - -" When searching try to be smart about cases -set smartcase - -" Highlight search results -set hlsearch - -" Makes search act like search in modern browsers -set incsearch - -" Don't redraw while executing macros (good performance config) -set lazyredraw - -" For regular expressions turn magic on -set magic - -" Show matching brackets when text indicator is over them -set showmatch -" How many tenths of a second to blink when matching brackets -set mat=2 - -" No annoying sound on errors -set noerrorbells -set novisualbell -set t_vb= -set tm=500 - -" Properly disable sound on errors on MacVim -if has("gui_macvim") - autocmd GUIEnter * set vb t_vb= -endif - - -" Add a bit extra margin to the left -set foldcolumn=1 - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Colors and Fonts -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Enable syntax highlighting -syntax enable - -" Enable 256 colors palette in Gnome Terminal -if $COLORTERM == 'gnome-terminal' - set t_Co=256 -endif - -try - colorscheme darkelf -catch -endtry - -set background=dark - -" Set extra options when running in GUI mode -if has("gui_running") - set guioptions-=T - set guioptions-=e - set t_Co=256 - set guitablabel=%M\ %t -endif - -" Set utf8 as standard encoding and en_US as the standard language -set encoding=utf8 - -" Use Unix as the standard file type -set ffs=unix,dos,mac - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Files, backups and undo -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Turn backup off, since most stuff is in SVN, git etc. anyway... -set nobackup -set nowb -set noswapfile - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Text, tab and indent related -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Use spaces instead of tabs -set expandtab - -" Be smart when using tabs ;) -set smarttab - -" 1 tab == 4 spaces -set shiftwidth=4 -set tabstop=4 - -" Linebreak on 500 characters -set lbr -set tw=500 - -set ai "Auto indent -set si "Smart indent -set wrap "Wrap lines - - -"""""""""""""""""""""""""""""" -" => Visual mode related -"""""""""""""""""""""""""""""" -" Visual mode pressing * or # searches for the current selection -" Super useful! From an idea by Michael Naumann -vnoremap * :call VisualSelection('', '')/=@/ -vnoremap # :call VisualSelection('', '')?=@/ - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Moving around, tabs, windows and buffers -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Map to / (search) and Ctrl- to ? (backwards search) -map / -map ? - -" Disable highlight when is pressed -map :noh - -" Smart way to move between windows -map j -map k -map h -map l - -" Close the current buffer -map bd :Bclose:tabclosegT - -" Close all the buffers -map ba :bufdo bd - -map bl :bnext -map bh :bprevious - -" Useful mappings for managing tabs -map tn :tabnew -map to :tabonly -map tc :tabclose -map tm :tabmove -map t :tabnext - -" Let 'tl' toggle between this and the last accessed tab -let g:lasttab = 1 -nmap tl :exe "tabn ".g:lasttab -au TabLeave * let g:lasttab = tabpagenr() - - -" Opens a new tab with the current buffer's path -" Super useful when editing files in the same directory -map te :tabedit =expand("%:p:h")/ - -" Switch CWD to the directory of the open buffer -map cd :cd %:p:h:pwd - -" Specify the behavior when switching between buffers -try - set switchbuf=useopen,usetab,newtab - set stal=2 -catch -endtry - -" Return to last edit position when opening files (You want this!) -au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif - - -"""""""""""""""""""""""""""""" -" => Status line -"""""""""""""""""""""""""""""" -" Always show the status line -set laststatus=2 - -" Format the status line -set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Editing mappings -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Remap VIM 0 to first non-blank character -map 0 ^ - -" Move a line of text using ALT+[jk] or Command+[jk] on mac -nmap mz:m+`z -nmap mz:m-2`z -vmap :m'>+`mzgv`yo`z -vmap :m'<-2`>my` - nmap - vmap - vmap -endif - -" Delete trailing white space on save, useful for some filetypes ;) -fun! CleanExtraSpaces() - let save_cursor = getpos(".") - let old_query = getreg('/') - silent! %s/\s\+$//e - call setpos('.', save_cursor) - call setreg('/', old_query) -endfun - -if has("autocmd") - autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee :call CleanExtraSpaces() -endif - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Spell checking -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Pressing ,ss will toggle and untoggle spell checking -map ss :setlocal spell! - -" Shortcuts using -map sn ]s -map sp [s -map sa zg -map s? z= - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Misc -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Remove the Windows ^M - when the encodings gets messed up -noremap m mmHmt:%s///ge'tzt'm - -" Quickly open a buffer for scribble -map q :e ~/buffer - -" Quickly open a markdown buffer for scribble -map x :e ~/buffer.md - -" Toggle paste mode on and off -map pp :setlocal paste! - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Helper functions -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Returns true if paste mode is enabled -function! HasPaste() - if &paste - return 'PASTE MODE ' - endif - return '' -endfunction - -" Don't close window, when deleting a buffer -command! Bclose call BufcloseCloseIt() -function! BufcloseCloseIt() - let l:currentBufNum = bufnr("%") - let l:alternateBufNum = bufnr("#") - - if buflisted(l:alternateBufNum) - buffer # - else - bnext - endif - - if bufnr("%") == l:currentBufNum - new - endif - - if buflisted(l:currentBufNum) - execute("bdelete! ".l:currentBufNum) - endif -endfunction - -function! CmdLine(str) - call feedkeys(":" . a:str) -endfunction - -function! VisualSelection(direction, extra_filter) range - let l:saved_reg = @" - execute "normal! vgvy" - - let l:pattern = escape(@", "\\/.*'$^~[]") - let l:pattern = substitute(l:pattern, "\n$", "", "") - - if a:direction == 'gv' - call CmdLine("Ack '" . l:pattern . "' " ) - elseif a:direction == 'replace' - call CmdLine("%s" . '/'. l:pattern . '/') - endif - - let @/ = l:pattern - let @" = l:saved_reg -endfunction diff --git a/nvim/disable/rocks.toml b/nvim/disable/rocks.toml deleted file mode 100644 index bb0dc17..0000000 --- a/nvim/disable/rocks.toml +++ /dev/null @@ -1,21 +0,0 @@ -# This is your rocks.nvim plugins declaration file. -# Here is a small yet pretty detailed example on how to use it: -# -# [plugins] -# nvim-treesitter = "semver_version" # e.g. "1.0.0" - -# List of non-Neovim rocks. -# This includes things like `toml` or other lua packages. -[rocks] - -# List of Neovim plugins to install alongside their versions. -# If the plugin name contains a dot then you must add quotes to the key name! -[plugins] -"rocks.nvim" = "2.43.1" # rocks.nvim can also manage itself :D -"rocks-config.nvim" = "3.1.0" -neorg = "9.3.0" -"rocks-git.nvim" = "2.5.3" - -[plugins.nvim-treesitter] -git = "nvim-treesitter/nvim-treesitter" -rev = "v0.9.3" diff --git a/nvim/init.lua b/nvim/init.lua index ae16150..4cfc3a6 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,20 +1,5 @@ -print("advent of neovim") - require("config.lazy") --- --- local o = vim.opt --- o.compatible = false --- o.number = true --- o.cmdheight = 2 --- o.expandtab = true --- o.smarttab = true --- o.shiftwidth = 4 --- o.tabstop = 4 --- o.ai = true --- o.si = true --- --- nvim_create_user_command("InsertTodayHeader", ':pu=strftime("# %a %d %b %Y")', {}) --- + vim.opt.compatible = false vim.opt.foldmethod = "expr" vim.opt.foldexpr = "v:lua.MyCustomFoldExpr()" @@ -23,7 +8,8 @@ vim.diagnostic.config({ virtual_text = true }) function _G.MyCustomFoldExpr() local line = vim.fn.getline(vim.v.lnum) if line:match("::$") then - return "=" -- keep the same fold level as the previous line + return "=" end - return vim.treesitter.foldexpr() + local ok, result = pcall(vim.treesitter.foldexpr) + return ok and result or "0" end diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json index 23ac53a..65a87fb 100644 --- a/nvim/lazyvim.json +++ b/nvim/lazyvim.json @@ -10,21 +10,14 @@ "lazyvim.plugins.extras.editor.mini-diff", "lazyvim.plugins.extras.editor.mini-files", "lazyvim.plugins.extras.editor.mini-move", - "lazyvim.plugins.extras.editor.neo-tree", "lazyvim.plugins.extras.editor.outline", - "lazyvim.plugins.extras.editor.snacks_explorer", "lazyvim.plugins.extras.editor.telescope", "lazyvim.plugins.extras.lang.ansible", - "lazyvim.plugins.extras.lang.clojure", "lazyvim.plugins.extras.lang.docker", "lazyvim.plugins.extras.lang.git", "lazyvim.plugins.extras.lang.helm", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", - "lazyvim.plugins.extras.lang.php", - "lazyvim.plugins.extras.lang.python", - "lazyvim.plugins.extras.lang.sql", - "lazyvim.plugins.extras.lang.toml", "lazyvim.plugins.extras.lang.yaml", "lazyvim.plugins.extras.util.dot", "lazyvim.plugins.extras.util.gitui", @@ -35,4 +28,4 @@ "NEWS.md": "11866" }, "version": 8 -} \ No newline at end of file +} diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index 6a87830..5eb904b 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -1,7 +1,21 @@ -- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- --- Add any additional autocmds here --- with `vim.api.nvim_create_autocmd` --- --- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) +-- By this point noice.nvim has already replaced vim.notify + +-- Log warnings and errors to file for debugging +local log_path = vim.fn.stdpath("log") .. "/nvim_errors.log" +local _notify = vim.notify +vim.notify = function(msg, level, opts) + if level and level >= vim.log.levels.WARN then + local f = io.open(log_path, "a") + if f then + f:write(string.format( + "[%s] %s: %s\n", + os.date("%Y-%m-%d %H:%M:%S"), + level == vim.log.levels.ERROR and "ERROR" or "WARN", + tostring(msg) + )) + f:close() + end + end + return _notify(msg, level, opts) +end diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index 727a938..7fcda78 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -1,12 +1,2 @@ -- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here --- --- vim.api.nvim_set_keymap("i", "jj", "", { noremap = false }) - -local wk = require("which-key") - -wk.add({ - { "N", group = "Notes" }, - { "Nt", ":Journal", desc = "Today" }, -}) +-- Use legendary.nvim to add named commands to the command palette diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index ec13966..588242f 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -18,8 +18,8 @@ vim.opt.rtp:prepend(lazypath) -- Make sure to setup `mapleader` and `maplocalleader` before -- loading lazy.nvim so that mappings are correct. -- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = "," -vim.g.maplocalleader = "," +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" -- Setup lazy.nvim require("lazy").setup({ diff --git a/nvim/lua/config/lazy.lua.diff b/nvim/lua/config/lazy.lua.diff deleted file mode 100644 index d73bfa1..0000000 --- a/nvim/lua/config/lazy.lua.diff +++ /dev/null @@ -1,53 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import/override with your plugins - { import = "plugins" }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - }, - install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { - enabled = true, -- check for plugin updates periodically - notify = false, -- notify on update - }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, -}) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 3ea1454..f394f09 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -1,3 +1,6 @@ -- Options are automatically loaded before lazy.nvim startup -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here +vim.opt.relativenumber = true +vim.opt.scrolloff = 8 +vim.opt.wrap = false +vim.opt.undofile = true diff --git a/nvim/lua/plugins.disable/chatgpt.lua b/nvim/lua/plugins.disable/chatgpt.lua deleted file mode 100644 index 2186a34..0000000 --- a/nvim/lua/plugins.disable/chatgpt.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "jackMort/ChatGPT.nvim", - event = "VeryLazy", - config = function() - require("chatgpt").setup({ - openai_params = { - model = "gpt-4.1" - } - }) - end, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "folke/trouble.nvim", -- optional - "nvim-telescope/telescope.nvim" - } -} diff --git a/nvim/lua/plugins.disable/copilot.lua b/nvim/lua/plugins.disable/copilot.lua deleted file mode 100644 index eda7b1a..0000000 --- a/nvim/lua/plugins.disable/copilot.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - { "zbirenbaum/copilot.lua", opts = { suggestion = { enabled = false } } }, -} diff --git a/nvim/lua/plugins.disable/example.lua b/nvim/lua/plugins.disable/example.lua deleted file mode 100644 index 17f53d6..0000000 --- a/nvim/lua/plugins.disable/example.lua +++ /dev/null @@ -1,197 +0,0 @@ --- since this is just an example spec, don't actually load anything here and return an empty spec --- stylua: ignore -if true then return {} end - --- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim --- --- In your plugin files, you can: --- * add extra plugins --- * disable/enabled LazyVim plugins --- * override the configuration of LazyVim plugins -return { - -- add gruvbox - { "ellisonleao/gruvbox.nvim" }, - - -- Configure LazyVim to load gruvbox - { - "LazyVim/LazyVim", - opts = { - colorscheme = "gruvbox", - }, - }, - - -- change trouble config - { - "folke/trouble.nvim", - -- opts will be merged with the parent spec - opts = { use_diagnostic_signs = true }, - }, - - -- disable trouble - { "folke/trouble.nvim", enabled = false }, - - -- override nvim-cmp and add cmp-emoji - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, - - -- change some telescope options and a keymap to browse plugin files - { - "nvim-telescope/telescope.nvim", - keys = { - -- add a keymap to browse plugin files - -- stylua: ignore - { - "fp", - function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, - desc = "Find Plugin File", - }, - }, - -- change some options - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, - }, - - -- add pyright to lspconfig - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- pyright will be automatically installed with mason and loaded with lspconfig - pyright = {}, - }, - }, - }, - - -- add tsserver and setup with typescript.nvim instead of lspconfig - { - "neovim/nvim-lspconfig", - dependencies = { - "jose-elias-alvarez/typescript.nvim", - init = function() - require("lazyvim.util").lsp.on_attach(function(_, buffer) - -- stylua: ignore - vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) - end) - end, - }, - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- tsserver will be automatically installed with mason and loaded with lspconfig - tsserver = {}, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - tsserver = function(_, opts) - require("typescript").setup({ server = opts }) - return true - end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - }, - }, - - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add more treesitter parsers - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - }, - }, - - -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above - -- would overwrite `ensure_installed` with the new value. - -- If you'd rather extend the default config, use the code below instead: - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - -- add tsx and treesitter - vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", - }) - end, - }, - - -- the opts function can also be used to change the default opts: - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, { - function() - return "😄" - end, - }) - end, - }, - - -- or you can return new options to override all the defaults - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - return { - --[[add your custom lualine config here]] - } - end, - }, - - -- use mini.starter instead of alpha - { import = "lazyvim.plugins.extras.ui.mini-starter" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - }, - }, - }, -} diff --git a/nvim/lua/plugins.disable/follow-md-links.lua b/nvim/lua/plugins.disable/follow-md-links.lua deleted file mode 100644 index b04a13e..0000000 --- a/nvim/lua/plugins.disable/follow-md-links.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "jghauser/follow-md-links.nvim", -} diff --git a/nvim/lua/plugins.disable/lualine.lua b/nvim/lua/plugins.disable/lualine.lua deleted file mode 100644 index 5f69610..0000000 --- a/nvim/lua/plugins.disable/lualine.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' } -} diff --git a/nvim/lua/plugins.disable/neo-tree.lua b/nvim/lua/plugins.disable/neo-tree.lua deleted file mode 100644 index 2510423..0000000 --- a/nvim/lua/plugins.disable/neo-tree.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "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", - -- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information - }, - lazy = false, -- neo-tree will lazily load itself - ---@module "neo-tree" - ---@type neotree.Config? - opts = { - -- fill any relevant options here - }, -} diff --git a/nvim/lua/plugins.disable/neorg.lua b/nvim/lua/plugins.disable/neorg.lua deleted file mode 100644 index d3a8d54..0000000 --- a/nvim/lua/plugins.disable/neorg.lua +++ /dev/null @@ -1,66 +0,0 @@ -return { - "nvim-neorg/neorg", - lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default - version = "*", -- Pin Neorg to the latest stable release - config = function() - require("neorg").setup({ - load = { - ["core.defaults"] = {}, -- Loads default behaviour - ["core.concealer"] = {}, -- Adds pretty icons to your documents - ["core.ui.calendar"] = {}, - ["core.completion"] = { config = { engine = { module_name = "external.lsp-completion" }, name = "[Norg]" } }, - ["core.esupports.metagen"] = { config = { type = "auto", update_date = true } }, - ["core.qol.toc"] = {}, - ["core.qol.todo_items"] = {}, - ["core.looking-glass"] = {}, - ["core.presenter"] = { config = { zen_mode = "zen-mode" } }, - ["core.export"] = {}, - ["core.export.markdown"] = { config = { extensions = "all" } }, - ["core.summary"] = {}, - ["core.tangle"] = { config = { report_on_empty = false } }, - ["core.dirman"] = { -- Manages Neorg workspaces - config = { - workspaces = { - notes = "~/Notes.neorg", - }, - default_workspace = "notes", - }, - }, - ["external.interim-ls"] = { - config = { - -- default config shown - completion_provider = { - -- Enable or disable the completion provider - enable = true, - - -- Show file contents as documentation when you complete a file name - documentation = true, - - -- Try to complete categories provided by Neorg Query. Requires `benlubas/neorg-query` - categories = false, - - -- suggest heading completions from the given file for `{@x|}` where `|` is your cursor - -- and `x` is an alphanumeric character. `{@name}` expands to `[name]{:$/people:# name}` - people = { - enable = false, - - -- path to the file you're like to use with the `{@x` syntax, relative to the - -- workspace root, without the `.norg` at the end. - -- ie. `folder/people` results in searching `$/folder/people.norg` for headings. - -- Note that this will change with your workspace, so it fails silently if the file - -- doesn't exist - path = "people", - }, - }, - }, - }, - ["core.keybinds"] = { - config = { - default_keybinds = true, - neorg_leader = "n", -- Change this to whatever you want - }, - }, - }, - }) - end, -} diff --git a/nvim/lua/plugins.disable/toggleterm.nvim b/nvim/lua/plugins.disable/toggleterm.nvim deleted file mode 100644 index f954052..0000000 --- a/nvim/lua/plugins.disable/toggleterm.nvim +++ /dev/null @@ -1,7 +0,0 @@ -return { - "akinsho/toggleterm.nvim", - tag = "*", - keys = { - { "td", "ToggleTerm size=40 dir=~ direction=horizontal", "Open Horizontal terminal in home directory"} - } -} diff --git a/nvim/lua/plugins.disable/treesitter.lua b/nvim/lua/plugins.disable/treesitter.lua deleted file mode 100644 index d0ce35f..0000000 --- a/nvim/lua/plugins.disable/treesitter.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter" -} diff --git a/nvim/lua/plugins.disable/twilight.lua b/nvim/lua/plugins.disable/twilight.lua deleted file mode 100644 index cceecb7..0000000 --- a/nvim/lua/plugins.disable/twilight.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "folke/twilight.nvim", - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, -} diff --git a/nvim/lua/plugins.disable/which-key.lua b/nvim/lua/plugins.disable/which-key.lua deleted file mode 100644 index 89b1ca0..0000000 --- a/nvim/lua/plugins.disable/which-key.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, - keys = { - { - { "N", group = "Neorg" }, - { "Nt", ":Neorg journal today", desc = "Today" }, - }, - }, -} ---{ "c", group = "ChatGPT" }, ---{ "cc", ":ChatGPT", desc = "ChatGPT" }, ---{ "ce", ":ChatGPTEditWithInstructions", desc = "ChatGPT Edit Selection with Instructions" }, diff --git a/nvim/lua/plugins/auto-session.lua b/nvim/lua/plugins/auto-session.lua deleted file mode 100644 index 20da845..0000000 --- a/nvim/lua/plugins/auto-session.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "rmagatti/auto-session", - lazy = false, - opts = { - suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, - }, -} diff --git a/nvim/lua/plugins/claude-code.lua b/nvim/lua/plugins/claude-code.lua new file mode 100644 index 0000000..f3679a9 --- /dev/null +++ b/nvim/lua/plugins/claude-code.lua @@ -0,0 +1,16 @@ +return { + "greggh/claude-code.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("claude-code").setup({ + window = { + position = "vertical", + split_ratio = 0.4, + }, + }) + end, + keys = { + { "cc", "ClaudeCode", desc = "Claude Code: Toggle" }, + { "cf", "ClaudeCodeFocus", desc = "Claude Code: Focus" }, + }, +} diff --git a/nvim/lua/plugins/interim-ls.lua b/nvim/lua/plugins/interim-ls.lua deleted file mode 100644 index f3520ad..0000000 --- a/nvim/lua/plugins/interim-ls.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "benlubas/neorg-interim-ls", -} diff --git a/nvim/lua/plugins/journal.lua b/nvim/lua/plugins/journal.lua deleted file mode 100644 index 4037f1b..0000000 --- a/nvim/lua/plugins/journal.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - "jakobkhansen/journal.nvim", - config = function() - require("journal").setup({ - filetype = "md", -- Filetype to use for new journal entries - root = "~/Notes/Personal/journals", -- Root directory for journal entries - date_format = "%Y-%m-%d", -- Date format for `:Journal ` - autocomplete_date_modifier = "end", -- "always"|"never"|"end". Enable date modifier autocompletion - - -- Configuration for journal entries - journal = { - -- Default configuration for `:Journal ` - format = "%Y_%m_%d", - template = "# %A %B %d %Y\n", - frequency = { day = 1 }, - - -- Nested configurations for `:Journal ... ` - entries = { - day = { - format = "%Y_%m_%d", -- Format of the journal entry in the filesystem. - template = "# %A %B %d %Y\n", -- Optional. Template used when creating a new journal entry - frequency = { day = 1 }, -- Optional. The frequency of the journal entry. Used for `:Journal next`, `:Journal -2` etc - }, - }, - }, - }) - end, -} diff --git a/nvim/lua/plugins/legendary.lua b/nvim/lua/plugins/legendary.lua new file mode 100644 index 0000000..dd6e72d --- /dev/null +++ b/nvim/lua/plugins/legendary.lua @@ -0,0 +1,17 @@ +return { + "mrjones2014/legendary.nvim", + priority = 10000, + lazy = false, + dependencies = { "nvim-telescope/telescope.nvim" }, + opts = { + telescope = { auto_register_which_key = false }, + keymaps = { + { "cc", description = "Claude Code: Toggle terminal" }, + { "cf", description = "Claude Code: Focus terminal" }, + }, + }, + keys = { + { "", "Legendary", desc = "Command Palette" }, + { "", "Legendary", desc = "Command Palette", mode = { "n", "i" } }, + }, +} diff --git a/nvim/lua/plugins/mkdnflow.lua b/nvim/lua/plugins/mkdnflow.lua deleted file mode 100644 index ae090f1..0000000 --- a/nvim/lua/plugins/mkdnflow.lua +++ /dev/null @@ -1,38 +0,0 @@ --- Configuration Documentation https://github.com/jakewvincent/mkdnflow.nvim?tab=readme-ov-file#%EF%B8%8F-configuration -return { - "jakewvincent/mkdnflow.nvim", - config = function() - require("mkdnflow").setup({ - -- Config goes here; leave blank for defaults - perspective = { - priority = "first", - root_tell = false, - }, - new_file_template = { - use_template = true, - placeholders = { - before = { - title = "link_title", - date = "os_date", - }, - after = {}, - }, - template = "# {{ title }}", - }, - links = { - style = "markdown", - name_is_source = false, - conceal = false, - context = 0, - implicit_extension = nil, - transform_implicit = false, - transform_explicit = function(text) - text = text:gsub(" ", "-") - text = text:lower() - return text - end, - create_on_follow_failure = true, - }, - }) - end, -} diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..bad58fe --- /dev/null +++ b/nvim/lua/plugins/oil.lua @@ -0,0 +1,15 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + lazy = false, + opts = { + default_file_explorer = true, + columns = { "icon" }, + view_options = { + show_hidden = true, + }, + }, + keys = { + { "-", "Oil", desc = "Open parent directory" }, + }, +}