From 91167c0b5a51fc12b4041739fc4d540e7ccf6d0e Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Tue, 19 Dec 2023 22:29:48 +0800 Subject: [PATCH 1/7] comfirm win install python script --- install.cmd | 40 ------------------------------------ install.py => win-install.py | 0 2 files changed, 40 deletions(-) delete mode 100644 install.cmd rename install.py => win-install.py (100%) diff --git a/install.cmd b/install.cmd deleted file mode 100644 index 4699991..0000000 --- a/install.cmd +++ /dev/null @@ -1,40 +0,0 @@ -:: This script is for configurating vim on windows 10 machine - -@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% -@if not exist "%HOME%" @set HOME=%USERPROFILE% - -@set NVIM_CONFIG_PATH=%HOME%\appdata\local\nvim\init.vim -@set APP_PATH=%HOME%\.dotfiles - -IF NOT EXIST "%APP_PATH%" ( - call git clone "https://github.com/Donaldttt/dotfiles" "%APP_PATH%" -) ELSE ( - @set ORIGINAL_DIR=%CD% - echo updating dotfiles - chdir /d "%APP_PATH%" - call git pull - chdir /d "%ORIGINAL_DIR%" - call cd "%APP_PATH%" -) - -:: Install vim-plug -curl -fLo %HOME%/vimfiles/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - -call mklink "%HOME%\.vimrc" "%APP_PATH%\.vimrc" -call mklink "%HOME%\.vimrc.bundles" "%APP_PATH%\.vimrc.bundles" - -IF NOT EXIST "%APP_PATH%\.vim" ( - call mkdir "%APP_PATH%\.vim" -) - -if exist "%NVIM_CONFIG_PATH%" ( - move "%NVIM_CONFIG_PATH%" "%NVIM_CONFIG_PATH%.backup"" -) - -( -echo set runtimepath+=~/.vim,~/.vim/after -echo set packpath+=~/.vim -echo source ~/.vimrc -)> %NVIM_CONFIG_PATH% - -call nvim -u "%APP_PATH%/.vimrc.bundles" +BundleInstall! +BundleClean +qall diff --git a/install.py b/win-install.py similarity index 100% rename from install.py rename to win-install.py From 32e4547a7f8b29e7222f54ce31461541e37a5037 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Tue, 19 Dec 2023 22:33:12 +0800 Subject: [PATCH 2/7] changing default and move on --- main.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.vim b/main.vim index 6c1c7da..653c797 100644 --- a/main.vim +++ b/main.vim @@ -7,7 +7,7 @@ " KEY_MAPS " OTHER_CONFIGS -let g:high_performence = v:false +let g:high_performence = v:true let g:autocomplte_enable = v:true let g:copilot_enable = v:true @@ -71,7 +71,7 @@ call plug#begin(g:plugin_dir) Plug 'dstein64/vim-startuptime', Cond(!g:high_performence) Plug 'simeji/winresizer', Cond(!g:high_performence) - Plug 'rust-lang/rust.vim', { 'for': ['rust'] } + " Plug 'rust-lang/rust.vim', { 'for': ['rust'] } Plug 'rhysd/conflict-marker.vim' @@ -103,7 +103,7 @@ call plug#begin(g:plugin_dir) endif Plug 'airblade/vim-rooter' - Plug 'justinmk/vim-sneak' + " Plug 'justinmk/vim-sneak' Plug 'airblade/vim-gitgutter' Plug 'chriskempson/base16-vim' " Plug 'Yggdroot/indentLine' @@ -112,9 +112,9 @@ call plug#begin(g:plugin_dir) Plug 'markonm/traces.vim' Plug 'voldikss/vim-floaterm', Cond(has('terminal') && g:vim_type == 'vim') set encoding=UTF-8 - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } - Plug 'junegunn/fzf.vim' - Plug 'antoinemadec/coc-fzf', Cond(g:os != 'Windows', {'on': ['CocFzfList']}) + " Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } + " Plug 'junegunn/fzf.vim' + " Plug 'antoinemadec/coc-fzf', Cond(g:os != 'Windows', {'on': ['CocFzfList']}) Plug 'Donaldttt/vim-bufferline' @@ -123,7 +123,7 @@ call plug#begin(g:plugin_dir) " Plug 'vim-airline/vim-airline-themes' Plug 'ryanoasis/vim-devicons' - Plug 'wfxr/minimap.vim', Cond(executable('code-minimap'), {'on' : ['MinimapToggle']}) + " Plug 'wfxr/minimap.vim', Cond(executable('code-minimap'), {'on' : ['MinimapToggle']}) endif if g:vim_type == 'nvim' From dfaee200956b9c3a7378d2116586c8597c4c790b Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Wed, 20 Dec 2023 19:30:13 +0800 Subject: [PATCH 3/7] add glazewm config --- .gitt | 0 config/config.yaml | 164 +++++++++++++++++++++++++++++++++++++++++++++ configg | 0 3 files changed, 164 insertions(+) create mode 100644 .gitt create mode 100644 config/config.yaml create mode 100644 configg diff --git a/.gitt b/.gitt new file mode 100644 index 0000000..e69de29 diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 0000000..bcb92c7 --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,164 @@ +gaps: + inner_gap: 5 + outer_gap: 5 + +bar: + height: 20 + position: "top" + opacity: 0.6 + # background: "#101010" + background: "#282c34" + # foreground: "white" + foreground: "#ffffff" + # font_family: "Segoe UI" + font_family: "Hack Nerd Mono" + font_size: "13" + padding: "1 6 1 6" + components_left: + - type: "workspaces" + opacity: 0.7 + components_right: + - type: "clock" + time_formatting: "hh:mm tt ddd MMM d" + +workspaces: + - name: 1 + - name: 2 + - name: 3 + - name: 4 + - name: 5 + - name: 6 + - name: 7 + - name: 8 + - name: 9 + +window_rules: + # Task Manager requires admin privileges to manage and should be ignored unless running + # the WM as admin. + - command: "ignore" + match_process_name: "Taskmgr" + match_process_name: "msrdc" + + # Launches system dialogs as floating by default (eg. File Explorer save/open dialog). + - command: "set floating" + match_class_name: "#32770" + + # Some applications (eg. Steam) have borders that extend past the normal border size. + - command: "resize borders 0px -7px -7px -7px" + match_process_name: "steam" + + - command: "set tiling" + match_process_name: "neovide" + +keybindings: + # Shift focus in a given direction. + - command: "focus left" + bindings: ["Alt+H", "Alt+Left"] + - command: "focus right" + bindings: ["Alt+L", "Alt+Right"] + - command: "focus up" + bindings: ["Alt+K", "Alt+Up"] + - command: "focus down" + bindings: ["Alt+J", "Alt+Down"] + + # Move focused window in a given direction. + - command: "move left" + bindings: ["Alt+Shift+H", "Alt+Shift+Left"] + - command: "move right" + bindings: ["Alt+Shift+L", "Alt+Shift+Right"] + - command: "move up" + bindings: ["Alt+Shift+K", "Alt+Shift+Up"] + - command: "move down" + bindings: ["Alt+Shift+J", "Alt+Shift+Down"] + + # Resize focused window by a percentage or pixel amount. + - command: "resize width -2%" + binding: "Alt+U" + - command: "resize width +2%" + binding: "Alt+P" + - command: "resize height +2%" + binding: "Alt+O" + - command: "resize height -2%" + binding: "Alt+I" + + # Change layout direction to be either horizontal or vertical. + - command: "layout horizontal" + binding: "Alt+Shift+V" + - command: "layout vertical" + binding: "Alt+V" + + # Change focus between floating / tiling windows. + - command: "toggle focus mode" + binding: "Alt+Space" + + # Change the focused window to be floating / tiling. + - command: "toggle floating" + binding: "Alt+Shift+Space" + + # Change the focused window to be maximized / unmaximized. + - command: "toggle maximized" + binding: "Alt+F" + + # Minimize focused window. + - command: "set minimized" + binding: "Alt+M" + + # Close focused window. + - command: "close" + binding: "Alt+Shift+Q" + + # Kill GlazeWM process safely. + - command: "exit wm" + binding: "Alt+Shift+E" + + # Re-evaluate configuration file. + - command: "reload config" + binding: "Alt+Shift+R" + + # Launch CMD terminal (alternatively `exec wt` or `exec %ProgramFiles%/Git/git-bash.exe` + # to start Windows Terminal and Git Bash respectively. + - command: "exec wt" + binding: "Alt+Enter" + + - command: "exec chrome" + binding: "Alt+F2" + + # Change focus to a workspace defined in `workspaces` config. + - command: "focus workspace 1" + binding: "Alt+1" + - command: "focus workspace 2" + binding: "Alt+2" + - command: "focus workspace 3" + binding: "Alt+3" + - command: "focus workspace 4" + binding: "Alt+4" + - command: "focus workspace 5" + binding: "Alt+5" + - command: "focus workspace 6" + binding: "Alt+6" + - command: "focus workspace 7" + binding: "Alt+7" + - command: "focus workspace 8" + binding: "Alt+8" + - command: "focus workspace 9" + binding: "Alt+9" + + # Move focused window to a workspace defined in `workspaces` config. + - commands: ["move to workspace 1", "focus workspace 1"] + binding: "Alt+Shift+1" + - commands: ["move to workspace 2", "focus workspace 2"] + binding: "Alt+Shift+2" + - commands: ["move to workspace 3", "focus workspace 3"] + binding: "Alt+Shift+3" + - commands: ["move to workspace 4", "focus workspace 4"] + binding: "Alt+Shift+4" + - commands: ["move to workspace 5", "focus workspace 5"] + binding: "Alt+Shift+5" + - commands: ["move to workspace 6", "focus workspace 6"] + binding: "Alt+Shift+6" + - commands: ["move to workspace 7", "focus workspace 7"] + binding: "Alt+Shift+7" + - commands: ["move to workspace 8", "focus workspace 8"] + binding: "Alt+Shift+8" + - commands: ["move to workspace 9", "focus workspace 9"] + bindings: ["Alt+Shift+9"] diff --git a/configg b/configg new file mode 100644 index 0000000..e69de29 From 651f913e3881336126c1816d91376209d0054adb Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Thu, 21 Dec 2023 16:20:46 +0800 Subject: [PATCH 4/7] . --- .../indent-blankline-nvim-config.lua | 11 +++++------ .../lua/lua-plugin-settings/project-nvim-config.lua | 4 ++-- .../lua/lua-plugin-settings/telescope-nvim-config.lua | 3 --- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/config/vim/lua/lua-plugin-settings/indent-blankline-nvim-config.lua b/config/vim/lua/lua-plugin-settings/indent-blankline-nvim-config.lua index bc2be7d..690a0e8 100644 --- a/config/vim/lua/lua-plugin-settings/indent-blankline-nvim-config.lua +++ b/config/vim/lua/lua-plugin-settings/indent-blankline-nvim-config.lua @@ -2,12 +2,11 @@ if not Animation_enable then if HasPlug('indent-blankline.nvim') then -- Example config in Lua - require("indent_blankline").setup { - show_current_context = true, - use_treesitter = true, - filetype_exclude = { "lspinfo", "packer", "checkhealth", - "help", "man", "", "startify", } - -- use_treesitter = true, + require("ibl").setup { + exclude = { + buftypes = {"lspinfo", "packer", "checkhealth", + "help", "man", "", "startify"}, + } } end end diff --git a/config/vim/lua/lua-plugin-settings/project-nvim-config.lua b/config/vim/lua/lua-plugin-settings/project-nvim-config.lua index cde75c8..1a00ccf 100644 --- a/config/vim/lua/lua-plugin-settings/project-nvim-config.lua +++ b/config/vim/lua/lua-plugin-settings/project-nvim-config.lua @@ -2,7 +2,7 @@ if HasPlug('project.nvim') then require("project_nvim").setup { detection_methods = { "lsp", "pattern" }, - patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", "src" }, + patterns = { ".git" }, -- Don't calculate root dir on specific directories -- Ex: { "~/.cargo/*", ... } @@ -11,7 +11,7 @@ if HasPlug('project.nvim') then show_hidden = false, -- When set to false, you will get a message when project.nvim changes your -- directory. - silent_chdir = false, + silent_chdir = true, -- Path where project.nvim will store the project history for use in -- telescope datapath = vim.g.vim_dir .. "/.vimproject/" diff --git a/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua b/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua index 70d4108..5e18615 100644 --- a/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua +++ b/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua @@ -11,9 +11,6 @@ if HasPlug('telescope.nvim') then layout_config) local layout = require('telescope.pickers.layout_strategies').horizontal(picker, max_columns, max_lines, layout_config) - layout.prompt.title = '' - layout.results.title = '' - layout.preview.title = '' -- layout.prompt.borderchars = { '─', '│', '─', '│', '┌', '┐', '┘', '└' } return layout end From 20e05c9d35b8f4629e6dc8221ab03deb62f8b518 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Thu, 21 Dec 2023 21:14:52 +0800 Subject: [PATCH 5/7] add glazewm config --- config/{ => glazewm}/config.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config/{ => glazewm}/config.yaml (100%) diff --git a/config/config.yaml b/config/glazewm/config.yaml similarity index 100% rename from config/config.yaml rename to config/glazewm/config.yaml From 726083eee1950983d9d3ce05efc5e92c7a1f9766 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Thu, 21 Dec 2023 21:15:28 +0800 Subject: [PATCH 6/7] . --- config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua b/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua index 5e18615..8d8970a 100644 --- a/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua +++ b/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua @@ -11,6 +11,8 @@ if HasPlug('telescope.nvim') then layout_config) local layout = require('telescope.pickers.layout_strategies').horizontal(picker, max_columns, max_lines, layout_config) + layout.prompt.title = '' + layout.results.title = '' -- layout.prompt.borderchars = { '─', '│', '─', '│', '┌', '┐', '┘', '└' } return layout end From a311601aea299174689f48212d8592d5b8980291 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Fri, 29 Dec 2023 19:34:35 +0800 Subject: [PATCH 7/7] . --- .vimrc | 7 +++++++ config/vim/autoload/os.vim | 6 ------ .../telescope-nvim-config.lua | 21 ++++++++----------- .../toggleterm-nvim-config.lua | 14 +++++++++++++ .../vim-matchup-config.lua | 9 -------- config/vim/plugin/config.vim | 4 ---- main.vim | 4 +--- 7 files changed, 31 insertions(+), 34 deletions(-) delete mode 100644 config/vim/lua/lua-plugin-settings/vim-matchup-config.lua diff --git a/.vimrc b/.vimrc index c7b3d6e..e76ab59 100644 --- a/.vimrc +++ b/.vimrc @@ -16,6 +16,13 @@ let g:isWSL = 0 if has("win64") || has("win32") || has("win16") let g:os = "Windows" + set updatetime=50 + if executable('pwsh') + " prefer to use powershell 7 + set shell=pwsh + else + set shell=powershell + endif else let g:os = substitute(system('uname'), '\n', '', '') if system('uname -r') =~ "icrosoft" diff --git a/config/vim/autoload/os.vim b/config/vim/autoload/os.vim index 52fba39..06fcc89 100644 --- a/config/vim/autoload/os.vim +++ b/config/vim/autoload/os.vim @@ -6,9 +6,3 @@ func! os#getOS() endif endfunc -function! os#setWindows() - set updatetime=50 - set shell=powershell -endfunction - - diff --git a/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua b/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua index 8d8970a..eaad70a 100644 --- a/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua +++ b/config/vim/lua/lua-plugin-settings/telescope-nvim-config.lua @@ -17,19 +17,7 @@ if HasPlug('telescope.nvim') then return layout end telescope.setup { - defaults = { - hidden = true, - vimgrep_arguments = vimgrep_arguments, - file_ignore_patterns = {"node_modules/", ".git/"}, - layout_config = { - -- prompt_position = "top", - }, - layout_strategy = "horizontal_merged", - }, pickers = { - find_files = { - hidden = true, - }, colorscheme = { enable_preview = true, mappings = { @@ -44,6 +32,15 @@ if HasPlug('telescope.nvim') then }, } }, + defaults = { + hidden = true, + vimgrep_arguments = vimgrep_arguments, + file_ignore_patterns = {"^node_modules/", "^.git/"}, + layout_config = { + -- prompt_position = "top", + }, + layout_strategy = "horizontal_merged", + }, extensions = { fzf = { fuzzy = true, -- false will only do exact matching diff --git a/config/vim/lua/lua-plugin-settings/toggleterm-nvim-config.lua b/config/vim/lua/lua-plugin-settings/toggleterm-nvim-config.lua index 3a9a6b8..60f3ef4 100644 --- a/config/vim/lua/lua-plugin-settings/toggleterm-nvim-config.lua +++ b/config/vim/lua/lua-plugin-settings/toggleterm-nvim-config.lua @@ -62,4 +62,18 @@ if HasPlug('toggleterm.nvim') then vim.api.nvim_set_keymap("x", "tl", string.format(":ToggleTermSendVisualSelection %d", ipythonId), { noremap = true, silent = true }) + + print(vim.o.shell) + if vim.o.shell == 'pwsh' or vim.o.shell == 'powershell' then + local powershell_options = { + shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;", + shellredir = "-RedirectStandardOutput %s -NoNewWindow -Wait", + shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode", + shellquote = "", + shellxquote = "", + } + for option, value in pairs(powershell_options) do + vim.opt[option] = value + end + end end diff --git a/config/vim/lua/lua-plugin-settings/vim-matchup-config.lua b/config/vim/lua/lua-plugin-settings/vim-matchup-config.lua deleted file mode 100644 index 4910a80..0000000 --- a/config/vim/lua/lua-plugin-settings/vim-matchup-config.lua +++ /dev/null @@ -1,9 +0,0 @@ - -if HasPlug('vim-illuminate') then - require'nvim-treesitter.configs'.setup { - matchup = { - enable = true, - disable = { }, - }, - } -end diff --git a/config/vim/plugin/config.vim b/config/vim/plugin/config.vim index 0563a8f..b7155e1 100644 --- a/config/vim/plugin/config.vim +++ b/config/vim/plugin/config.vim @@ -6,8 +6,4 @@ let g:loaded_vim_config = 1 let os = os#getOS() -if os == 'Windows' - call os#setWindows() -endif - call options#init() diff --git a/main.vim b/main.vim index 653c797..c5fb384 100644 --- a/main.vim +++ b/main.vim @@ -7,7 +7,7 @@ " KEY_MAPS " OTHER_CONFIGS -let g:high_performence = v:true +let g:high_performence = v:false let g:autocomplte_enable = v:true let g:copilot_enable = v:true @@ -45,14 +45,12 @@ call plug#begin(g:plugin_dir) Plug 'tek256/simple-dark' Plug 'sainnhe/everforest' Plug 'bluz71/vim-moonfly-colors', { 'as': 'moonfly' } - " Plug 'jacoborus/tender.vim' Plug 'cocopon/iceberg.vim' Plug 'catppuccin/nvim', Cond( has('nvim-0.8.2') \|\| g:vim_v >= 900 , { 'as': 'catppuccin' }) Plug 'NLKNguyen/papercolor-theme' Plug 'EdenEast/nightfox.nvim', Cond(has('nvim-0.5')) Plug 'projekt0n/github-nvim-theme', Cond(has('nvim-0.5'), { 'tag': 'v0.0.7' }) Plug 'folke/tokyonight.nvim', Cond(g:vim_type == 'nvim', { 'branch': 'main' }) - " Plug 'junegunn/goyo.vim', { 'on': ['Goyo'] } Plug 'andymass/vim-matchup' endif Plug 'Donaldttt/fuzzyy'