From 63c033020c5055963381812ad7e812964f786f9a Mon Sep 17 00:00:00 2001 From: Yinzuo Jiang Date: Mon, 12 Aug 2024 11:43:27 +0800 Subject: [PATCH] refactor!: remove .ideavimrc, .obsidian.vimrc, alacritty --- .ideavimrc | 25 --- .obsidian.vimrc | 36 ----- root/.vim/autoload/fzf_custom/fzf.vim | 5 + root/.vim/vimrc.d/fzf.vim | 2 + terminal/README.md | 2 +- terminal/alacritty.ahk | 15 -- terminal/alacritty.yml | 209 -------------------------- terminal/alapasty.vim | 77 ---------- 8 files changed, 8 insertions(+), 363 deletions(-) delete mode 100644 .ideavimrc delete mode 100644 .obsidian.vimrc delete mode 100644 terminal/alacritty.ahk delete mode 100644 terminal/alacritty.yml delete mode 100644 terminal/alapasty.vim diff --git a/.ideavimrc b/.ideavimrc deleted file mode 100644 index 1c43716..0000000 --- a/.ideavimrc +++ /dev/null @@ -1,25 +0,0 @@ -" options and mappings that are supported by both Vim and IdeaVim - -if has('ide') - " mappings and options that exist only in IdeaVim - set sneak - set incsearch - " see :actionlist - nmap fh (RecentFiles) - nmap fmt (ReformatCode) - nmap rg (FindInPath) - nmap ff (GotoFile) - imap (Find) - if &ide =~? 'intellij idea' - if &ide =~? 'community' - " some mappings and options for IntelliJ IDEA Community Edition - elseif &ide =~? 'ultimate' - " some mappings and options for IntelliJ IDEA Ultimate Edition - endif - elseif &ide =~? 'pycharm' - " PyCharm specific mappings and options - endif -else - " some mappings for Vim/Neovim - " nnoremap f Telescope find_files -endif diff --git a/.obsidian.vimrc b/.obsidian.vimrc deleted file mode 100644 index 8cc6edc..0000000 --- a/.obsidian.vimrc +++ /dev/null @@ -1,36 +0,0 @@ -" Yank to system clipboard -set clipboard=unnamed - -" Go back and forward with Ctrl+O and Ctrl+I -" (make sure to remove default Obsidian shortcuts for these to work) -" exmap back obcommand app:go-back -" nmap :back -" exmap forward obcommand app:go-forward -" nmap :forward - -exmap vsp obcommand workspace:split-vertical -exmap tabnew obcommand workspace:new-tab -exmap q obcommand workspace:close -exmap qa obcommand workspace:close-window - -" Emulate Folding https://vimhelp.org/fold.txt.html#fold-commands -exmap togglefold obcommand editor:toggle-fold -nmap zo :togglefold -nmap zc :togglefold -nmap za :togglefold - -exmap unfoldall obcommand editor:unfold-all -nmap zR :unfoldall - -exmap foldall obcommand editor:fold-all -nmap zM :foldall - -" Emulate Tab Switching https://vimhelp.org/tabpage.txt.html#gt -" requires Cycle Through Panes Plugins https://obsidian.md/plugins?id=cycle-through-panes -" exmap tabnext obcommand cycle-through-panes:cycle-through-panes -" nmap gt :tabnext -" exmap tabprev obcommand cycle-through-panes:cycle-through-panes-reverse -" nmap gT :tabprev - -exmap Vex obcommand file-explorer:open -exmap Find obcommand global-search:open diff --git a/root/.vim/autoload/fzf_custom/fzf.vim b/root/.vim/autoload/fzf_custom/fzf.vim index cc30d2e..e3a89de 100644 --- a/root/.vim/autoload/fzf_custom/fzf.vim +++ b/root/.vim/autoload/fzf_custom/fzf.vim @@ -4,3 +4,8 @@ function fzf_custom#fzf#mergetool_start(f) tabclose -1 endfunction +function fzf_custom#fzf#backup(f) + let current_ft = &ft + exe 'vsp ' . a:f + exe 'set ft=' . current_ft +endfunction diff --git a/root/.vim/vimrc.d/fzf.vim b/root/.vim/vimrc.d/fzf.vim index 90548de..42f868b 100644 --- a/root/.vim/vimrc.d/fzf.vim +++ b/root/.vim/vimrc.d/fzf.vim @@ -172,4 +172,6 @@ command -nargs=0 SpacedRepetitionAdd call asyncrun#run('', {'silent': 1}, $VIMRC " [[palette]]读取常用项目配置文件 :ReadProjectFile command! -nargs=0 ReadProjectFile call fzf#run(fzf#wrap({'source': "find ~/vimrc/project_files -type f", 'sink': 'read', 'options': ['--prompt', 'ProjectFile > ', '--preview', 'cat {}', '--preview-window', 'up,60%']})) +command! -nargs=0 BackupFile call fzf#run(fzf#wrap({'source': "find ~/.vim/backup" . expand('%:p') . '* -type f', 'sink': function("fzf_custom#fzf#backup"), 'options': ['--tac', '--no-sort', '--prompt', 'BackupFile> ', '--preview', 'head -n 1000 {}', '--preview-window', 'up,60%']})) + command! -nargs=0 Dictionary call fzf#run(fzf#wrap('dictionary', {'source': 'cat ' . &dict, 'sink': function("s:paste_word")})) diff --git a/terminal/README.md b/terminal/README.md index 3827724..22f0aef 100644 --- a/terminal/README.md +++ b/terminal/README.md @@ -1,4 +1,4 @@ -alacritty windows彩色emoji:https://github.com/alacritty/alacritty/issues/3082 +alacritty已从v0.22.0删除,最后一次commit见 ac5affb8c8c8268299c2c124683b25c6e8cde012 WSL快速编辑wezterm配置文件 ```bash diff --git a/terminal/alacritty.ahk b/terminal/alacritty.ahk deleted file mode 100644 index c5e8275..0000000 --- a/terminal/alacritty.ahk +++ /dev/null @@ -1,15 +0,0 @@ -; https://github.com/alacritty/alacritty/issues/2324 -#Requires AutoHotkey v2 - -#HotIf WinActive("ahk_exe Alacritty-v0.12.2-portable.exe") - -; Ctrl+Shift+V -- change line endings -^+v:: -{ - A_Clipboard := StrReplace(A_Clipboard, "`r`n", "`n") - Send("^+v") -} -return - -#HotIf - diff --git a/terminal/alacritty.yml b/terminal/alacritty.yml deleted file mode 100644 index 0a56ed0..0000000 --- a/terminal/alacritty.yml +++ /dev/null @@ -1,209 +0,0 @@ -font: - size: 14 - normal: - family: FiraCode Nerd Font - style: Regular - - bold: - family: FiraCode Nerd Font - style: Bold - - italic: - family: FiraCode Nerd Font - style: Italic - - bold_italic: - family: FiraCode Nerd Font - style: Bold Italic - - -env: - TERM: xterm-256color - -shell: - # windows - program: ubuntu2204.exe - -window: - decorations: Full - dynamic_padding: true - startup_mode: Maximized - -# Dracula theme for Alacritty -# https://draculatheme.com/alacritty -# -# Color palette -# https://spec.draculatheme.com -# -# Template -# https://github.com/alacritty/alacritty/blob/master/alacritty.yml - -# colors: -# primary: -# background: '#282a36' -# foreground: '#f8f8f2' -# bright_foreground: '#ffffff' -# cursor: -# text: CellBackground -# cursor: CellForeground -# vi_mode_cursor: -# text: CellBackground -# cursor: CellForeground -# search: -# matches: -# foreground: '#44475a' -# background: '#50fa7b' -# focused_match: -# foreground: '#44475a' -# background: '#ffb86c' -# footer_bar: -# background: '#282a36' -# foreground: '#f8f8f2' -# hints: -# start: -# foreground: '#282a36' -# background: '#f1fa8c' -# end: -# foreground: '#f1fa8c' -# background: '#282a36' -# line_indicator: -# foreground: None -# background: None -# selection: -# text: CellForeground -# background: '#44475a' -# normal: -# black: '#21222c' -# red: '#ff5555' -# green: '#50fa7b' -# yellow: '#f1fa8c' -# blue: '#bd93f9' -# magenta: '#ff79c6' -# cyan: '#8be9fd' -# white: '#f8f8f2' -# bright: -# black: '#6272a4' -# red: '#ff6e6e' -# green: '#69ff94' -# yellow: '#ffffa5' -# blue: '#d6acff' -# magenta: '#ff92df' -# cyan: '#a4ffff' -# white: '#ffffff' - -# Colors (Solarized Dark) -colors: - # Default colors - primary: - background: '0x002b36' - foreground: '0x839496' - - # Normal colors - normal: - black: '0x073642' - red: '0xdc322f' - green: '0x859900' - yellow: '0xb58900' - blue: '0x268bd2' - magenta: '0xd33682' - cyan: '0x2aa198' - white: '0xeee8d5' - - # Bright colors - bright: - black: '0x002b36' - red: '0xcb4b16' - green: '0x586e75' - yellow: '0x657b83' - blue: '0x839496' - magenta: '0x6c71c4' - cyan: '0x93a1a1' - white: '0xfdf6e3' - -# Colors (Solarized Light) -# colors: -# # Default colors -# primary: -# background: '0xfdf6e3' -# foreground: '0x586e75' -# -# # Normal colors -# normal: -# black: '0x073642' -# red: '0xdc322f' -# green: '0x859900' -# yellow: '0xb58900' -# blue: '0x268bd2' -# magenta: '0xd33682' -# cyan: '0x2aa198' -# white: '0xeee8d5' -# -# # Bright colors -# bright: -# black: '0x002b36' -# red: '0xcb4b16' -# green: '0x586e75' -# yellow: '0x657b83' -# blue: '0x839496' -# magenta: '0x6c71c4' -# cyan: '0x93a1a1' -# white: '0xfdf6e3' - -# Colors (Nord) - -# colors: -# -# # Default colors -# -# primary: -# -# background: '0x2E3440' -# -# foreground: '0xD8DEE9' -# -# -# -# # Normal colors -# -# normal: -# -# black: '0x3B4252' -# -# red: '0xBF616A' -# -# green: '0xA3BE8C' -# -# yellow: '0xEBCB8B' -# -# blue: '0x81A1C1' -# -# magenta: '0xB48EAD' -# -# cyan: '0x88C0D0' -# -# white: '0xE5E9F0' -# -# -# -# # Bright colors -# -# bright: -# -# black: '0x4C566A' -# -# red: '0xBF616A' -# -# green: '0xA3BE8C' -# -# yellow: '0xEBCB8B' -# -# blue: '0x81A1C1' -# -# magenta: '0xB48EAD' -# -# cyan: '0x8FBCBB' -# -# white: '0xECEFF4' - -key_bindings: - - { key: N, mods: Control|Shift, action: SpawnNewInstance } diff --git a/terminal/alapasty.vim b/terminal/alapasty.vim deleted file mode 100644 index a52fad5..0000000 --- a/terminal/alapasty.vim +++ /dev/null @@ -1,77 +0,0 @@ -" Paste text from alacritty (windows) into vim without additional blanklines -" Issue: https://github.com/alacritty/alacritty/issues/2324 -" -" Place this vim file in a plugin directory of vim. Example: $HOME/.vim/plugin/alapasty.vim -" Type `:Ap` to open up a buffer in insert mode. Use `Shift+Insert` to copy text into this buffer. -" Press and the text will be formatted and placed in the originating buffer -" -" Note: This plugin takes care of some common edge-cases when working with code. Make sure the first few lines are -" either blank (just line endings is okay) or it has the first line of the content you want to paste. -" This is critical because the script uses "%normal jdd" to dispatch repetitive jump and delete motions over the entire file. -" -" Author: Sai Sasidhar Maddali -" -if exists('alapasty') || &cp - finish -endif -let alapasty=1 - -let AlapastyBufferName = ".alapasty" - -function! s:AlapastyCreate() - let bufn = bufnr(g:AlapastyBufferName) - if bufn == -1 - exe "new " . g:AlapastyBufferName - else - exe "split +buffer" . bufn - endif - exe ":%d" - set paste - exe "startinsert" -endfunction - -function! s:AlapastyManipulate() - " count empty lines in the beginning of the buffer - let ls = line('$') - let ix = 1 - while ls >= ix - let line = getbufline('$', ix) - if len(line[0]) != 0 - break - endif - let ix += 1 - endwhile - - " remove empty lines - normal! gg - while ix > 1 - exe ":0d" - let ix -= 1 - endwhile - - " skip formatting and pasting if it does not make any sense (default line feed for an empty buffer) - if line('$') == 1 - let line = getbufline('$', ix) - if len(line[0]) == 0 - exe "hide" - return - endif - endif - - " jump every other line and delete it - exe "%normal jdd" - normal! Gygg - exe "hide" - normal! p -endfunction - -function! s:AlapastySetProps() - setlocal buftype=nofile - setlocal bufhidden=hide - setlocal noswapfile - setlocal buflisted -endfunction - -autocmd BufNewFile .alapasty call s:AlapastySetProps() -autocmd InsertLeave .alapasty call s:AlapastyManipulate() -command! Ap call s:AlapastyCreate()