From f65d81fcf6d356be689ad95b4b757d24b48e77b2 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 7 Oct 2022 02:37:49 +0900 Subject: [PATCH 01/25] add: install_ubuntu.sh and fd link --- bin/install_ubuntu.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 bin/install_ubuntu.sh diff --git a/bin/install_ubuntu.sh b/bin/install_ubuntu.sh new file mode 100644 index 0000000..44d8094 --- /dev/null +++ b/bin/install_ubuntu.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash -euo + +ln -s $(which fdfind) ~/.local/bin/fd From 9222bb5b08be81fc41533af8ba4414cc6bdc87dd Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 7 Oct 2022 02:45:36 +0900 Subject: [PATCH 02/25] add: bat symln to setup_ubuntu.sh --- bin/install_ubuntu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/install_ubuntu.sh b/bin/install_ubuntu.sh index 44d8094..46d0777 100644 --- a/bin/install_ubuntu.sh +++ b/bin/install_ubuntu.sh @@ -1,3 +1,4 @@ #!/usr/bin/bash -euo -ln -s $(which fdfind) ~/.local/bin/fd +ln -sf $(which batcat) ~/.local/bin/bat +ln -sf $(which fdfind) ~/.local/bin/fd From 48f76c89913b5571d4088aa9b587e8d3200a391a Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 7 Oct 2022 02:59:00 +0900 Subject: [PATCH 03/25] remove: bat, fd symlinks for ubuntu reason:: removed apt packages for bat, fd, since they are too old for PatrickF1/fzf.fish plugin --- bin/install_ubuntu.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/bin/install_ubuntu.sh b/bin/install_ubuntu.sh index 46d0777..b11fb91 100644 --- a/bin/install_ubuntu.sh +++ b/bin/install_ubuntu.sh @@ -1,4 +1,2 @@ #!/usr/bin/bash -euo -ln -sf $(which batcat) ~/.local/bin/bat -ln -sf $(which fdfind) ~/.local/bin/fd From e62e449da70d72cfe92adc0f0efc947c04633555 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 7 Oct 2022 04:02:07 +0900 Subject: [PATCH 04/25] add: fish: config.fish to resolve julia driver problem --- dotfiles/fish/config.fish | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 428fa5c..cfbf773 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -7,3 +7,8 @@ end # opam configuration source /home/qwjyh/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true + +# julia +# to solve Graphic Card driver problem +export LD_PRELOAD=/usr/lib64/libstdc++.so.6 + From e1138795c022e5c602b1cbd5d39630db87c4fe68 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 7 Oct 2022 04:03:34 +0900 Subject: [PATCH 05/25] add: install.sh symlinks --- bin/install.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 bin/install.sh diff --git a/bin/install.sh b/bin/install.sh new file mode 100644 index 0000000..55f001e --- /dev/null +++ b/bin/install.sh @@ -0,0 +1,13 @@ +#!/usr/bin/fish + +# test working directory + + +# symlink +#ln -s ~/.config/fish/config.fish dotfiles/fish/config.fish +cp ~/.config/fish/config.fish (pwd)/dotfiles/fish/config.fish +ln -s (pwd)/dotfiles/fish/config.fish ~/.config/fish/config.fish +ln -s (pwd)/dotfiles/starship/starship.toml ~/.config/starship.toml +ln -sf (pwd)/dotfiles/neovim/init.lua ~/.config/nvim/init.lua +ln -sf (pwd)/dotfiles/neovim/lua/plugins.lua ~/.config/nvim/lua/plugins.lua + From c7d7b4204eab8a020bba2bd849959e4817001e0e Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 7 Oct 2022 04:03:59 +0900 Subject: [PATCH 06/25] (WIP) add nvim satysfi configs (need more config for lsp-config) --- dotfiles/neovim/init.lua | 7 +++++++ .../server_configuration/satysfi-ls.lua | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 dotfiles/neovim/lua/lspconfig/server_configuration/satysfi-ls.lua diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index d7bdd8e..7097cb2 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -138,3 +138,10 @@ cmp.setup({ vim.api.nvim_set_keymap('n', '', "lua require('fzf-lua').files()", { noremap = true, silent = true }) + + +----------------------------------------------------------- +-- satysfi language server +require('lspconfig')['satysfi-ls'].setup{ + autostart = true +} diff --git a/dotfiles/neovim/lua/lspconfig/server_configuration/satysfi-ls.lua b/dotfiles/neovim/lua/lspconfig/server_configuration/satysfi-ls.lua new file mode 100644 index 0000000..78e30f7 --- /dev/null +++ b/dotfiles/neovim/lua/lspconfig/server_configuration/satysfi-ls.lua @@ -0,0 +1,20 @@ +# https://zenn.dev/monaqa/articles/2021-12-10-satysfi-language-server +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'satysfi-language-server' }, + filetypes = { 'satysfi' }, + root_dir = util.root_pattern('.git'), + single_file_support = true, + }, + docs = { + description = [[ + https://github.com/monaqa/satysfi-language-server + Language server for SATySFi. + ]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} From 05147b5aeaf8c385d8dfbf4ddd47a8f9cd4441ab Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 12 Oct 2022 08:45:23 +0900 Subject: [PATCH 07/25] update fish config & init.lua --- dotfiles/fish/config.fish | 37 +++++++++++++++++++++---------------- dotfiles/neovim/init.lua | 1 + 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 09b6f19..b93a205 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -2,23 +2,28 @@ # bass source ~/.bashrc if status is-interactive - # starship - starship init fish | source - - function set_win_title - echo -ne "\033]0; (basename "$PWD") \007" - end - set starship_precmd_uesr_func "set_win_title" - - # keychain - set -x SHELL fish - keychain --eval --quiet -Q id_rsa, id_ed25519 | source - set -x SHELL bash - - # opam - # source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true end +# starship +starship init fish | source + +function set_win_title + echo -ne "\033]0; (basename "$PWD") \007" +end +set starship_precmd_uesr_func "set_win_title" + +# keychain +set -x SHELL fish +keychain --eval --quiet -Q id_rsa, id_ed25519 | source +set -x SHELL bash + +# opam +# source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true +opam env --shell fish | source # key bindings -bind \b backward-kill-word \ No newline at end of file +bind \b backward-kill-word + + +# env +set -x LESS '-i -r -M -R -S -W -z-4 -x4' diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index d7bdd8e..4819b76 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -1,3 +1,4 @@ +--print("init.lua loaded") ----------------------------------------------------------- -- basic configurations vim.o.number = true From ef2d9a239d70b0d711020cb451870bf112253e2a Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 12 Oct 2022 10:26:59 +0900 Subject: [PATCH 08/25] update: sh: install script --- bin/install.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/bin/install.sh b/bin/install.sh index cabc0ff..6870622 100644 --- a/bin/install.sh +++ b/bin/install.sh @@ -1 +1,22 @@ -ln -s (pwd)/dotfiles/fish/config.fish ~/.config/fish/config.fish +#!/usr/bin/bash +set -eu + +# ========================================================= +# check executing location +# ========================================================= +if [ ! -d "bin" -a ! -d "dotfiles" ]; then + echo "Wrong execution location" + echo "Please run this script on dotfiles root folder." + exit 1 +fi + + +# ========================================================= +# links +# ========================================================= +ln -sf (pwd)/dotfiles/fish/config.fish ~/.config/fish/config.fish +ln -sf (pwd)/dotfiles/starship/starship.toml ~/.config/starship.toml +ln -sf (pwd)/dotfiles/tmux.conf ~/.tmux.conf + + +ln -sf (pwd)/dotfiles/nvim/init.lua ~/.config/nvim/init.lua From 90de93e9fabf6aff076e1b2604d13bd658ec128b Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 12 Oct 2022 11:21:48 +0900 Subject: [PATCH 09/25] =?UTF-8?q?fix:=20fish=E3=81=AB=E6=85=A3=E3=82=8C?= =?UTF-8?q?=E3=81=99=E3=81=8E=E3=81=9F=E5=BC=8A=E5=AE=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 bin/install.sh diff --git a/bin/install.sh b/bin/install.sh old mode 100644 new mode 100755 index 6870622..d33bc00 --- a/bin/install.sh +++ b/bin/install.sh @@ -14,9 +14,9 @@ fi # ========================================================= # links # ========================================================= -ln -sf (pwd)/dotfiles/fish/config.fish ~/.config/fish/config.fish -ln -sf (pwd)/dotfiles/starship/starship.toml ~/.config/starship.toml -ln -sf (pwd)/dotfiles/tmux.conf ~/.tmux.conf +ln -sf $(pwd)/dotfiles/fish/config.fish ~/.config/fish/config.fish +ln -sf $(pwd)/dotfiles/starship/starship.toml ~/.config/starship.toml +ln -sf $(pwd)/dotfiles/tmux.conf ~/.tmux.conf -ln -sf (pwd)/dotfiles/nvim/init.lua ~/.config/nvim/init.lua +ln -sf $(pwd)/dotfiles/nvim/init.lua ~/.config/nvim/init.lua From 66027b05c248aaf7facf696e2fefe9e7ecf33388 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 17 Oct 2022 15:58:17 +0900 Subject: [PATCH 10/25] fix: ahk: Hankaku/Zenkaku behavior --- dotfiles/ahk/extra_remaps.ahk | 8 ++++---- dotfiles/ahk/key_remaps.ahk | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dotfiles/ahk/extra_remaps.ahk b/dotfiles/ahk/extra_remaps.ahk index 1229096..5effd07 100644 --- a/dotfiles/ahk/extra_remaps.ahk +++ b/dotfiles/ahk/extra_remaps.ahk @@ -2,10 +2,10 @@ ; mainly for inputting special characters ; Play/Pause -sc121:: - Send {Media_Play_Pause} - return - +;sc121:: +; Send {Media_Play_Pause} +; return +; ; Henkan/Muhenkan + - -> en, em dash vk1D & vkBD:: diff --git a/dotfiles/ahk/key_remaps.ahk b/dotfiles/ahk/key_remaps.ahk index 3f90df4..70722db 100644 --- a/dotfiles/ahk/key_remaps.ahk +++ b/dotfiles/ahk/key_remaps.ahk @@ -57,12 +57,11 @@ vk1C & d:: Send,{Blind}{PgDn} return +; ========================================== +; include extra key remaps +#Include extra_remaps.ahk ; ========================================== ; HankakuZenkaku to esc sc029:: Send, {Escape} - -; ========================================== -; include extra key remaps -#Include extra_remaps.ahk From 745234408a81f0833ef308a478969799d5553fd5 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 17 Oct 2022 16:56:28 +0900 Subject: [PATCH 11/25] add: neovim: lualine --- bin/install.ps1 | 4 ++- dotfiles/neovim/init.lua | 13 ++++++++- dotfiles/neovim/lua/lualine_setup.lua | 40 +++++++++++++++++++++++++++ dotfiles/neovim/lua/plugins.lua | 6 ++++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 dotfiles/neovim/lua/lualine_setup.lua diff --git a/bin/install.ps1 b/bin/install.ps1 index 0aa87d8..87905bd 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -49,7 +49,9 @@ scoop import .\bin\scoop_apps\scoop_minimal_apps.json # make symbolic links # neovim -New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\init.vim -Target (Resolve-Path .\dotfiles\neovim\init.vim) -Force +New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\init.lua -Target (Resolve-Path .\dotfiles\neovim\init.lua) -Force +New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\plugins.lua -Target (Resolve-Path .\dotfiles\neovim\lua\plugins.lua) -Force +New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lualine_setup.lua -Target (Resolve-Path .\dotfiles\neovim\lua\lualine_setup.lua) -Force # pwsh New-Item -ItemType SymbolicLink -Path $PROFILE -Target (Resolve-Path .\dotfiles\pwsh\powershell_profile.ps1) -Force New-Item -ItemType SymbolicLink -Path ~\.config\powershell\chezmoi_completion.ps1 -Target (Resolve-Path .\dotfiles\pwsh\chezmoi_completion.ps1) -Force diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index d7bdd8e..4a6db37 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -3,7 +3,8 @@ vim.o.number = true vim.o.relativenumber = true vim.cmd([[ -highlight LineNr cterm=none ctermfg=256 +highlight LineNr cterm=none ctermfg=243 +highlight CursorLineNr cterm=none ctermfg=250 ]]) vim.o.tabstop = 4 vim.o.shiftwidth = 4 @@ -138,3 +139,13 @@ cmp.setup({ vim.api.nvim_set_keymap('n', '', "lua require('fzf-lua').files()", { noremap = true, silent = true }) + + +----------------------------------------------------------- +-- lualine +require('lualine_setup') +lualine = require('lualine') +lualine.setup({ + options = { theme = 'iceberg_dark' } +}) +lualine.setup() diff --git a/dotfiles/neovim/lua/lualine_setup.lua b/dotfiles/neovim/lua/lualine_setup.lua new file mode 100644 index 0000000..6d5017a --- /dev/null +++ b/dotfiles/neovim/lua/lualine_setup.lua @@ -0,0 +1,40 @@ +require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '|', right = '|'}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} +} diff --git a/dotfiles/neovim/lua/plugins.lua b/dotfiles/neovim/lua/plugins.lua index 86506f7..4ec117b 100644 --- a/dotfiles/neovim/lua/plugins.lua +++ b/dotfiles/neovim/lua/plugins.lua @@ -9,6 +9,12 @@ return require('packer').startup(function(use) --requires = { 'kyazdan142/nvim-web/devicons' } -- not found } + -- lualine(statusline) + use { + 'nvim-lualine/lualine.nvim', + requires = { 'kyazdani42/nvim-web-devicons', opt = true } + } + -- LSP use 'neovim/nvim-lspconfig' use "williamboman/mason.nvim" From 9fef6bf5be56841aa3c941253dcf7e4d287e81bc Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 17 Oct 2022 17:34:30 +0900 Subject: [PATCH 12/25] add: pwsh: save my custom history --- dotfiles/pwsh/powershell_profile.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dotfiles/pwsh/powershell_profile.ps1 b/dotfiles/pwsh/powershell_profile.ps1 index ea5f655..9ed7b93 100644 --- a/dotfiles/pwsh/powershell_profile.ps1 +++ b/dotfiles/pwsh/powershell_profile.ps1 @@ -31,9 +31,16 @@ Set-Alias whereis where.exe # starship # change window name +# save my history +$My_Pwsh_History = "$HOME\my_pwsh_history.txt" function Invoke-Starship-PreCommand { + # window title $ParentFolder = Split-Path $PWD -Leaf $host.ui.Write("`e]0; $ParentFolder `a") + + # save log + Write-Output "$(Get-Date -UFormat '+%Y-%m-%d %H:%M:%S') $env:COMPUTERNAME`:$PID [$Global:LASTEXITCODE] $(Get-History -Count 1)" + | Out-File -FilePath $My_Pwsh_History -Append -Encoding utf8 } Invoke-Expression (&starship init powershell) $ENV:STARSHIP_CONFIG = "$HOME\.config\starship.toml" From fa55d353fca2205b2d03c97fbf593e2b375d90ad Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 17 Oct 2022 19:54:14 +0900 Subject: [PATCH 13/25] add: fish: abbr.fish --- dotfiles/fish/abbr.fish | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 dotfiles/fish/abbr.fish diff --git a/dotfiles/fish/abbr.fish b/dotfiles/fish/abbr.fish new file mode 100644 index 0000000..58f97cf --- /dev/null +++ b/dotfiles/fish/abbr.fish @@ -0,0 +1,2 @@ +abbr -a -U -- l less +abbr -a -U -- ll 'exa -la --icons --git' From 350e366184c1c462eb6e7479315fca15935f0f25 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 17 Oct 2022 20:18:35 +0900 Subject: [PATCH 14/25] fix: install.sh mkdir --- bin/install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/install.sh b/bin/install.sh index bf53e3b..62903fb 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -14,9 +14,11 @@ fi # ========================================================= # links # ========================================================= +mkdir -p ~/.config/fish ln -sf $(pwd)/dotfiles/fish/config.fish ~/.config/fish/config.fish ln -sf $(pwd)/dotfiles/starship/starship.toml ~/.config/starship.toml ln -sf $(pwd)/dotfiles/tmux.conf ~/.tmux.conf +mkdir -p ~/.config/nvim ln -sf $(pwd)/dotfiles/neovim/init.lua ~/.config/nvim/init.lua -ln -sf $(pwd)/dotfiles/neovim/lua/plugins.lua ~/.config/nvim/lua/plugins.lua \ No newline at end of file +ln -sf $(pwd)/dotfiles/neovim/lua/plugins.lua ~/.config/nvim/lua/plugins.lua From 80b671e6b93f14ecd2f6f50f38f3861a43b96f39 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 17 Oct 2022 20:25:00 +0900 Subject: [PATCH 15/25] fix: install.sh mkdir --- bin/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/install.sh b/bin/install.sh index 62903fb..544686c 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -21,4 +21,6 @@ ln -sf $(pwd)/dotfiles/tmux.conf ~/.tmux.conf mkdir -p ~/.config/nvim ln -sf $(pwd)/dotfiles/neovim/init.lua ~/.config/nvim/init.lua +mkdir -p ~/.config/nvim/lua ln -sf $(pwd)/dotfiles/neovim/lua/plugins.lua ~/.config/nvim/lua/plugins.lua + From c4a3fc6a1b9f6213135b12f00675f136351bcdeb Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Oct 2022 02:45:36 +0900 Subject: [PATCH 16/25] remove: neovim: lsp configs --- dotfiles/neovim/init.lua | 174 +++++++++++++++++++-------------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 4a085fb..7e35275 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -49,95 +49,95 @@ vim.cmd [[autocmd BufWritePost plugins.lua PackerCompile]] -- LSP -- https://zenn.dev/botamotch/articles/21073d78bc68bf -- 1. LSP Sever management -require('mason').setup() -require('mason-lspconfig').setup_handlers({ function(server) - local opt = { - -- -- Function executed when the LSP server startup - -- on_attach = function(client, bufnr) - -- local opts = { noremap=true, silent=true } - -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) - -- vim.cmd 'autocmd BufWritePre * lua vim.lsp.buf.formatting_sync(nil, 1000)' - -- end, - capabilities = require('cmp_nvim_lsp').update_capabilities( - vim.lsp.protocol.make_client_capabilities() - ) - } - require('lspconfig')[server].setup(opt) -end }) - --- 2. build-in LSP function --- keyboard shortcut -vim.keymap.set('n', 'K', 'lua vim.lsp.buf.hover()') -vim.keymap.set('n', 'gf', 'lua vim.lsp.buf.formatting()') -vim.keymap.set('n', 'gr', 'lua vim.lsp.buf.references()') -vim.keymap.set('n', 'gd', 'lua vim.lsp.buf.definition()') -vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.declaration()') -vim.keymap.set('n', 'gi', 'lua vim.lsp.buf.implementation()') -vim.keymap.set('n', 'gt', 'lua vim.lsp.buf.type_definition()') -vim.keymap.set('n', 'gn', 'lua vim.lsp.buf.rename()') -vim.keymap.set('n', 'ga', 'lua vim.lsp.buf.code_action()') -vim.keymap.set('n', 'ge', 'lua vim.diagnostic.open_float()') -vim.keymap.set('n', 'g]', 'lua vim.diagnostic.goto_next()') -vim.keymap.set('n', 'g[', 'lua vim.diagnostic.goto_prev()') --- LSP handlers -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false } -) --- Reference highlight -vim.cmd [[ -set updatetime=500 -highlight LspReferenceText cterm=underline ctermfg=1 ctermbg=8 gui=underline guifg=#A00000 guibg=#104040 -highlight LspReferenceRead cterm=underline ctermfg=1 ctermbg=8 gui=underline guifg=#A00000 guibg=#104040 -highlight LspReferenceWrite cterm=underline ctermfg=1 ctermbg=8 gui=underline guifg=#A00000 guibg=#104040 -augroup lsp_document_highlight - autocmd! - autocmd CursorHold,CursorHoldI * lua vim.lsp.buf.document_highlight() - autocmd CursorMoved,CursorMovedI * lua vim.lsp.buf.clear_references() -augroup END -]] - --- 3. completion (hrsh7th/nvim-cmp) -local cmp = require("cmp") -cmp.setup({ - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - sources = { - { name = "nvim_lsp" }, - -- { name = "buffer" }, - -- { name = "path" }, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm { select = true }, - }), - experimental = { - ghost_text = true, - }, -}) --- cmp.setup.cmdline('/', { --- mapping = cmp.mapping.preset.cmdline(), --- sources = { --- { name = 'buffer' } --- } --- }) --- cmp.setup.cmdline(":", { --- mapping = cmp.mapping.preset.cmdline(), --- sources = { --- { name = "path" }, --- { name = "cmdline" }, --- }, --- }) +--require('mason').setup() +--require('mason-lspconfig').setup_handlers({ function(server) +-- local opt = { +-- -- -- Function executed when the LSP server startup +-- -- on_attach = function(client, bufnr) +-- -- local opts = { noremap=true, silent=true } +-- -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) +-- -- vim.cmd 'autocmd BufWritePre * lua vim.lsp.buf.formatting_sync(nil, 1000)' +-- -- end, +-- capabilities = require('cmp_nvim_lsp').update_capabilities( +-- vim.lsp.protocol.make_client_capabilities() +-- ) +-- } +-- require('lspconfig')[server].setup(opt) +--end }) +-- +---- 2. build-in LSP function +---- keyboard shortcut +--vim.keymap.set('n', 'K', 'lua vim.lsp.buf.hover()') +--vim.keymap.set('n', 'gf', 'lua vim.lsp.buf.formatting()') +--vim.keymap.set('n', 'gr', 'lua vim.lsp.buf.references()') +--vim.keymap.set('n', 'gd', 'lua vim.lsp.buf.definition()') +--vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.declaration()') +--vim.keymap.set('n', 'gi', 'lua vim.lsp.buf.implementation()') +--vim.keymap.set('n', 'gt', 'lua vim.lsp.buf.type_definition()') +--vim.keymap.set('n', 'gn', 'lua vim.lsp.buf.rename()') +--vim.keymap.set('n', 'ga', 'lua vim.lsp.buf.code_action()') +--vim.keymap.set('n', 'ge', 'lua vim.diagnostic.open_float()') +--vim.keymap.set('n', 'g]', 'lua vim.diagnostic.goto_next()') +--vim.keymap.set('n', 'g[', 'lua vim.diagnostic.goto_prev()') +---- LSP handlers +--vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( +-- vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false } +--) +---- Reference highlight +--vim.cmd [[ +--set updatetime=500 +--highlight LspReferenceText cterm=underline ctermfg=1 ctermbg=8 gui=underline guifg=#A00000 guibg=#104040 +--highlight LspReferenceRead cterm=underline ctermfg=1 ctermbg=8 gui=underline guifg=#A00000 guibg=#104040 +--highlight LspReferenceWrite cterm=underline ctermfg=1 ctermbg=8 gui=underline guifg=#A00000 guibg=#104040 +--augroup lsp_document_highlight +-- autocmd! +-- autocmd CursorHold,CursorHoldI * lua vim.lsp.buf.document_highlight() +-- autocmd CursorMoved,CursorMovedI * lua vim.lsp.buf.clear_references() +--augroup END +--]] +-- +---- 3. completion (hrsh7th/nvim-cmp) +--local cmp = require("cmp") +--cmp.setup({ +-- snippet = { +-- expand = function(args) +-- vim.fn["vsnip#anonymous"](args.body) +-- end, +-- }, +-- sources = { +-- { name = "nvim_lsp" }, +-- -- { name = "buffer" }, +-- -- { name = "path" }, +-- }, +-- mapping = cmp.mapping.preset.insert({ +-- [""] = cmp.mapping.select_prev_item(), +-- [""] = cmp.mapping.select_next_item(), +-- [''] = cmp.mapping.complete(), +-- [''] = cmp.mapping.abort(), +-- [""] = cmp.mapping.confirm { select = true }, +-- }), +-- experimental = { +-- ghost_text = true, +-- }, +--}) +---- cmp.setup.cmdline('/', { +---- mapping = cmp.mapping.preset.cmdline(), +---- sources = { +---- { name = 'buffer' } +---- } +---- }) +---- cmp.setup.cmdline(":", { +---- mapping = cmp.mapping.preset.cmdline(), +---- sources = { +---- { name = "path" }, +---- { name = "cmdline" }, +---- }, +---- }) -- satysfi language server -require('lspconfig')['satysfi-ls'].setup{ - autostart = true -} +--require('lspconfig')['satysfi-ls'].setup{ +-- autostart = true +--} ----------------------------------------------------------- -- Ctrl + P to invoke fzf file search From f97cb0d155ba4adb751d8a9be425fc7c1a24df7f Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Oct 2022 02:48:02 +0900 Subject: [PATCH 17/25] add: pwsh: rclone completion --- dotfiles/pwsh/powershell_profile.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dotfiles/pwsh/powershell_profile.ps1 b/dotfiles/pwsh/powershell_profile.ps1 index 9ed7b93..49d3111 100644 --- a/dotfiles/pwsh/powershell_profile.ps1 +++ b/dotfiles/pwsh/powershell_profile.ps1 @@ -192,3 +192,7 @@ $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" if (Test-Path($ChocolateyProfile)) { Import-Module "$ChocolateyProfile" } + +# rclone +rclone completion powershell | Out-String | Invoke-Expression + From 0eb454de763fb432420828d1610f81ac2a749163 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Oct 2022 10:21:40 +0900 Subject: [PATCH 18/25] introduce local patch --- dotfiles/fish/config.fish | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 590b7dd..a65e4a9 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -16,7 +16,7 @@ if status is-interactive set -x SHELL bash # opam - source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true + #source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true end # starship @@ -50,9 +50,7 @@ function save_myhistory --on-event fish_prompt -d "Save custom shell log to $my_ >> $my_fish_history end - -# julia -# to solve Graphic Card driver problem -export LD_PRELOAD=/usr/lib64/libstdc++.so.6 +# load local patch +source ~/.config/fish/local_patch.fish From 0e28eac85a5e336721e65565b49b836657653194 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Oct 2022 12:39:45 +0900 Subject: [PATCH 19/25] fix: install.sh neovim/lualine link --- bin/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/install.sh b/bin/install.sh index 544686c..792fc31 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -23,4 +23,5 @@ mkdir -p ~/.config/nvim ln -sf $(pwd)/dotfiles/neovim/init.lua ~/.config/nvim/init.lua mkdir -p ~/.config/nvim/lua ln -sf $(pwd)/dotfiles/neovim/lua/plugins.lua ~/.config/nvim/lua/plugins.lua +ln -sf $(pwd)/dotfiles/neovim/lua/lualine_setup.lua ~/.config/nvim/lua/lualine_setup.lua From 972bca253f06102a6ef3fc8fa2bd070c9bff930f Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 18 Oct 2022 17:53:45 +0900 Subject: [PATCH 20/25] add: pwsh: npm completion --- bin/install.ps1 | 3 +++ dotfiles/pwsh/powershell_profile.ps1 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bin/install.ps1 b/bin/install.ps1 index 87905bd..5459e75 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -33,6 +33,8 @@ Write-Output "Latest PSReadLine" Install-Module -Name PSReadLine -Force # Override default version to get the latest one Write-Output "CompletionPredictor" Install-Module -Name CompletionPredictor +Write-Output "npm" +Install-Module -Name npm-completion @@ -52,6 +54,7 @@ scoop import .\bin\scoop_apps\scoop_minimal_apps.json New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\init.lua -Target (Resolve-Path .\dotfiles\neovim\init.lua) -Force New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\plugins.lua -Target (Resolve-Path .\dotfiles\neovim\lua\plugins.lua) -Force New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lualine_setup.lua -Target (Resolve-Path .\dotfiles\neovim\lua\lualine_setup.lua) -Force +New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lsp_client_config.lua -Target (Resolve-Path .\dotfiles\neovim\lua\lsp_client_config.lua) -Force # pwsh New-Item -ItemType SymbolicLink -Path $PROFILE -Target (Resolve-Path .\dotfiles\pwsh\powershell_profile.ps1) -Force New-Item -ItemType SymbolicLink -Path ~\.config\powershell\chezmoi_completion.ps1 -Target (Resolve-Path .\dotfiles\pwsh\chezmoi_completion.ps1) -Force diff --git a/dotfiles/pwsh/powershell_profile.ps1 b/dotfiles/pwsh/powershell_profile.ps1 index 49d3111..45f5dbd 100644 --- a/dotfiles/pwsh/powershell_profile.ps1 +++ b/dotfiles/pwsh/powershell_profile.ps1 @@ -196,3 +196,6 @@ if (Test-Path($ChocolateyProfile)) { # rclone rclone completion powershell | Out-String | Invoke-Expression +# node +Import-Module npm-completion + From 61cd03500123a68e844aa45d0f6654fb54abd8eb Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 19 Oct 2022 12:12:40 +0900 Subject: [PATCH 21/25] update TODO --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index fcf5d2d..68c7df7 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ my dotfiles # TODO - make install script for Linux + - fish setup + - fisher + - abbr - add rc files of Manjaro - neovim configs - lsp-config From 28c0c3ac8341d28084bf7e689c2edb0caeab32f3 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 21 Oct 2022 16:55:07 +0900 Subject: [PATCH 22/25] moved scoop_apps to windows/ --- bin/install.ps1 | 4 ++-- bin/{ => windows}/scoop_apps/scoop_apps.json | 0 bin/{ => windows}/scoop_apps/scoop_minimal_apps.json | 0 bin/{ => windows}/scoop_apps/update_scoop_list.ps1 | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename bin/{ => windows}/scoop_apps/scoop_apps.json (100%) rename bin/{ => windows}/scoop_apps/scoop_minimal_apps.json (100%) rename bin/{ => windows}/scoop_apps/update_scoop_list.ps1 (100%) diff --git a/bin/install.ps1 b/bin/install.ps1 index 87905bd..526cb4a 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -43,8 +43,8 @@ if(!(Get-Command scoop -ErrorAction SilentlyContinue)) { } # install basic scoop apps # import from exported json file -# to update the json file, execute ./bin/scoop_apps/update_scoop_list.ps1 -scoop import .\bin\scoop_apps\scoop_minimal_apps.json +# to update the json file, execute ./bin/windows/scoop_apps/update_scoop_list.ps1 +scoop import .\bin\windows\scoop_apps\scoop_minimal_apps.json # make symbolic links diff --git a/bin/scoop_apps/scoop_apps.json b/bin/windows/scoop_apps/scoop_apps.json similarity index 100% rename from bin/scoop_apps/scoop_apps.json rename to bin/windows/scoop_apps/scoop_apps.json diff --git a/bin/scoop_apps/scoop_minimal_apps.json b/bin/windows/scoop_apps/scoop_minimal_apps.json similarity index 100% rename from bin/scoop_apps/scoop_minimal_apps.json rename to bin/windows/scoop_apps/scoop_minimal_apps.json diff --git a/bin/scoop_apps/update_scoop_list.ps1 b/bin/windows/scoop_apps/update_scoop_list.ps1 similarity index 100% rename from bin/scoop_apps/update_scoop_list.ps1 rename to bin/windows/scoop_apps/update_scoop_list.ps1 From 2c158b438646a1af87f82833dbff6666ca946fdd Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 21 Oct 2022 17:13:19 +0900 Subject: [PATCH 23/25] add fisher plugins install script --- bin/linux/fisher_plugins.fish | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 bin/linux/fisher_plugins.fish diff --git a/bin/linux/fisher_plugins.fish b/bin/linux/fisher_plugins.fish new file mode 100644 index 0000000..8e90ab1 --- /dev/null +++ b/bin/linux/fisher_plugins.fish @@ -0,0 +1,20 @@ +#!/bin/fish + +#========================================================== +# fisher plugin install +#========================================================== + +# check fisher existence +if ! type fisher &>/dev/null + echo "fisher does not exist." + echo "Please install fisher." + return 1 +end + +fisher update + +# installing packages +fisher install edc/bass +#fisher install jethrokuan/z +fisher install patrickf1/fzf.fish + From f7232b229bc4bd4d0fb6d2587ad5a8b64445cf9f Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 21 Oct 2022 17:30:24 +0900 Subject: [PATCH 24/25] add: fish: auto fisher install --- bin/linux/fisher_plugins.fish | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/linux/fisher_plugins.fish b/bin/linux/fisher_plugins.fish index 8e90ab1..1595c1b 100644 --- a/bin/linux/fisher_plugins.fish +++ b/bin/linux/fisher_plugins.fish @@ -7,8 +7,17 @@ # check fisher existence if ! type fisher &>/dev/null echo "fisher does not exist." - echo "Please install fisher." - return 1 + echo "Please install fisher from https://github.com/jorgebucaran/fisher" + echo "" + echo "==Automatic install==" + echo "You can run `curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher` right here" + echo "be sure to check install command on the fisher project homepage." + read -p "echo Install\?(default Y / N):\ " ans + if [ $ans = 'N' ] + return 1 + end + # install script from github page + curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher end fisher update From d315d6ad530ef450b5381c1a3a58cb1c063b1bc8 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Sat, 22 Oct 2022 01:30:28 +0900 Subject: [PATCH 25/25] add: alacritty.yml & $EDITOR & fisher_plugin chmod --- README.md | 3 -- bin/install_manjaro.sh | 5 +++ bin/linux/fisher_plugins.fish | 0 dotfiles/alacritty.yml | 85 +++++++++++++++++++++++++++++++++++ dotfiles/fish/config.fish | 3 ++ 5 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 bin/install_manjaro.sh mode change 100644 => 100755 bin/linux/fisher_plugins.fish create mode 100644 dotfiles/alacritty.yml diff --git a/README.md b/README.md index 68c7df7..fcf5d2d 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,6 @@ my dotfiles # TODO - make install script for Linux - - fish setup - - fisher - - abbr - add rc files of Manjaro - neovim configs - lsp-config diff --git a/bin/install_manjaro.sh b/bin/install_manjaro.sh new file mode 100644 index 0000000..5fa4ca1 --- /dev/null +++ b/bin/install_manjaro.sh @@ -0,0 +1,5 @@ +#!/usr/bin/bash -euo + +# alacritty config +ln -sf (pwd)/dotfiles/alacritty.yml ~/.config/alacritty/alacritty.yml + diff --git a/bin/linux/fisher_plugins.fish b/bin/linux/fisher_plugins.fish old mode 100644 new mode 100755 diff --git a/dotfiles/alacritty.yml b/dotfiles/alacritty.yml new file mode 100644 index 0000000..e8a1ec4 --- /dev/null +++ b/dotfiles/alacritty.yml @@ -0,0 +1,85 @@ +# Alacritty config file + +# Window +window: + decorations: none + opacity: 0.85 + + +# Font +font: + size: 11.0 + +# Color schemes +schemes: + # Campbell (Windows 10 default) + campbell: &campbell + # Default colors + primary: + background: '#0c0c0c' + foreground: '#cccccc' + + # Normal colors + normal: + black: '#0c0c0c' + red: '#c50f1f' + green: '#13a10e' + yellow: '#c19c00' + blue: '#0037da' + magenta: '#881798' + cyan: '#3a96dd' + white: '#cccccc' + + # Bright colors + bright: + black: '#767676' + red: '#e74856' + green: '#16c60c' + yellow: '#f9f1a5' + blue: '#3b78ff' + magenta: '#b4009e' + cyan: '#61d6d6' + white: '#f2f2f2' + # Colors (Iceberg Dark) + iceberg_dark: &iceberg_dark + # Default colors + primary: + background: '#161821' + foreground: '#d2d4de' + + # Normal colors + normal: + black: '#161821' + red: '#e27878' + green: '#b4be82' + yellow: '#e2a478' + blue: '#84a0c6' + magenta: '#a093c7' + cyan: '#89b8c2' + white: '#c6c8d1' + + # Bright colors + bright: + black: '#6b7089' + red: '#e98989' + green: '#c0ca8e' + yellow: '#e9b189' + blue: '#91acd1' + magenta: '#ada0d3' + cyan: '#95c4ce' + white: '#d2d4de' + # Colors (Monokai Dark) + monokai: &iceberg_dark + +# startup shell +shell: + program: /usr/bin/tmux + args: + - a + + +# key bindings +key_bindings: + - { key: Key0, mods: Control, action: ResetFontSize } + - { key: Semicolon, mods: Control, action: IncreaseFontSize } + - { key: Minus, mods: Control, action: DecreaseFontSize } diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index a65e4a9..76b227c 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -42,6 +42,9 @@ bind \b backward-kill-word # env set -x LESS '-i -r -M -R -S -W -z-4 -x4' +set -x EDITOR "/usr/bin/nvim" + + # save fish log to my custom file set -gx my_fish_history "$HOME/my_fish_history.txt" function save_myhistory --on-event fish_prompt -d "Save custom shell log to $my_fish_history"