From 700cecd2ae85092d9a9bd5fb679bd923ad589257 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 18 Mar 2024 10:33:28 +0900 Subject: [PATCH 1/9] change: nvim: cmp settings (Replace -> Insert, selection requirement) --- dotfiles/neovim/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index a952464..7337660 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -673,8 +673,8 @@ cmp.setup { [''] = cmp.mapping.scroll_docs(4), -- Down [''] = cmp.mapping.complete(), [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, + behavior = cmp.ConfirmBehavior.Insert, + select = false, }, [''] = cmp.mapping(function(fallback) if cmp.visible() then From b2978b4fd2dbecc33876bf27be8d795c48e9f4b4 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 18 Mar 2024 10:34:11 +0900 Subject: [PATCH 2/9] update: nvim: add load condition to term_powershell --- dotfiles/neovim/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 7337660..03c2efe 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -18,6 +18,9 @@ require('lazy').setup({ { "catppuccin/nvim", name = "catppuccin" }, -- Color scheme { dir = "./lua/term_powershell.lua", + cond = function() + return vim.fn.has('win32') == 1 + end, event = "CmdlineEnter", config = function() require("term_powershell").setup { From 13d4d48a4e4589ae273212ba7e803d9f48470de0 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Sun, 31 Mar 2024 12:11:26 +0900 Subject: [PATCH 3/9] remove JET.nvim related --- bin/install.ps1 | 1 - bin/install.sh | 1 - dotfiles/neovim/init.lua | 25 ------- .../lspconfig/server_configurations/jetls.lua | 68 ------------------- 4 files changed, 95 deletions(-) delete mode 100644 dotfiles/neovim/lua/lspconfig/server_configurations/jetls.lua diff --git a/bin/install.ps1 b/bin/install.ps1 index 989928e..99e8f8e 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -55,7 +55,6 @@ New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\init.lua -Target (Res 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\term_powershell.lua -Target (Resolve-Path .\dotfiles\neovim\lua\term_powershell.lua) -Force New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lspconfig\server_configurations\satysfi_ls.lua -Target (Resolve-Path .\dotfiles\neovim\lua\lspconfig\server_configurations\satysfi_ls.lua) -Force -New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lspconfig\server_configurations\jetls.lua -Target (Resolve-Path .\dotfiles\neovim\lua\lspconfig\server_configurations\jetls.lua) -Force mkdir $env:LOCALAPPDATA\nvim\after\ftplugin New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\ftplugin\satysfi.lua -Target (Resolve-Path .\dotfiles\neovim\after\ftplugin\satysfi.lua) New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\ftplugin\tex.lua -Target (Resolve-Path .\dotfiles\neovim\after\ftplugin\tex.lua) diff --git a/bin/install.sh b/bin/install.sh index 166cc7e..357d8a0 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -27,7 +27,6 @@ ln -sf $(pwd)/dotfiles/neovim/lua/lualine_setup.lua ~/.config/nvim/lua/lualine_s ln -sf $(pwd)/dotfiles/neovim/lua/term_powershell.lua ~/.config/nvim/lua/term_powershell.lua mkdir -p ~/.config/nvim/lua/lspconfig/server_configurations ln -sf $(pwd)/dotfiles/neovim/lua/lspconfig/server_configurations/satysfi_ls.lua ~/.config/nvim/lua/lspconfig/server_configurations/satysfi_ls.lua -ln -sf $(pwd)/dotfiles/neovim/lua/lspconfig/server_configurations/jetls.lua ~/.config/nvim/lua/lspconfig/server_configurations/jetls.lua mkdir -p ~/.config/nvim/after/ftplugin ln -sf $(pwd)/dotfiles/neovim/after/ftplugin/satysfi.lua ~/.config/nvim/after/ftplugin/satysfi.lua ln -sf $(pwd)/dotfiles/neovim/after/ftplugin/tex.lua ~/.config/nvim/after/ftplugin/tex.lua diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 03c2efe..9c46fd8 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -62,29 +62,6 @@ require('lazy').setup({ 'lervag/vimtex', ft = { 'tex', 'latex' }, }, - { - -- 'kdheepak/JET.nvim', - -- 'qwjyh/JET.nvim', - dir = '~/work/julia/JET.nvim', - -- dev = false, -- set true to use dir - lazy = true, - dependencies = { - 'jose-elias-alvarez/null-ls.nvim', - }, - config = function() - require("jet").setup { - timeout = 15000, - -- disable setup since null-ls doesn't support lspconfig - -- https://github.com/jose-elias-alvarez/null-ls.nvim/commit/656e5cb554fed1eb2f398f325511601fab988ce0 - setup_lspconfig = false, - debug = true, - } - end, - -- build process(make environments and add JET.jl) - build = - [[mkdir -p ~/.julia/environments/nvim-null-ls && julia --startup-file=no --project=~/.julia/environments/nvim-null-ls -e 'using Pkg; Pkg.add("JET")']], - -- ft = { 'julia', }, - }, { 'hkupty/iron.nvim', ft = { 'julia', 'python', 'ruby', 'lua', }, @@ -621,8 +598,6 @@ lspconfig.powershell_es.setup { bundle_path = '~/scoop/apps/powershell-editorservice/current', capabilities = capabilities, } --- -- jetls --- lspconfig.jetls.setup {} -- ccls -- -- csharp -- lspconfig.omnisharp.setup { diff --git a/dotfiles/neovim/lua/lspconfig/server_configurations/jetls.lua b/dotfiles/neovim/lua/lspconfig/server_configurations/jetls.lua deleted file mode 100644 index 6f6f599..0000000 --- a/dotfiles/neovim/lua/lspconfig/server_configurations/jetls.lua +++ /dev/null @@ -1,68 +0,0 @@ --- local cmd = { --- 'julia', --- '--startup-file=no', --- '--history-file=no', --- '-e', --- [[ --- # Load JETLS.jl: attempt to load from ~/.julia/environments/nvim-lspconfig --- # with the regular load path as a fallback --- jet_install_path = joinpath( --- get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")), --- "environments", "nvim-lspconfig" --- ) --- pushfirst!(LOAD_PATH, jet_install_path) --- using JETLS --- popfirst!(LOAD_PATH) --- depot_path = get(ENV, "JULIA_DEPOT_PATH", "") --- project_path = let --- dirname(something( --- ## 1. Finds an explicitly set project (JULIA_PROJECT) --- Base.load_path_expand(( --- p = get(ENV, "JULIA_PROJECT", nothing); --- p === nothing ? nothing : isempty(p) ? nothing : p --- )), --- ## 2. Look for a Project.toml file in the current working directory, --- ## or parent directories, with $HOME as an upper boundary --- Base.current_project(), --- ## 3. First entry in the load path --- get(Base.load_path(), 1, nothing), --- ## 4. Fallback to default global environment, --- ## this is more or less unreachable --- Base.load_path_expand("@v#.#"), --- )) --- end --- @info "Running JETLS language server" VERSION pwd() project_path --- @info "not running yet" --- JETLS.runserver(stdin, stdout) --- ]], --- } -local cmd = { - 'julia', - '--startup-file=no', - '--history-file=no', - '-e', - [[ - println("===STARTING JETLS===") - using JETLS - JETLS.runserver(stdin, stdout) - @info "Running JETLS" VERSION pwd() project_path - @info "============================" - ]], -} - -return { - default_config = { - cmd = cmd, - filetypes = { 'julia' }, - root_dir = function(fname) - local util = require 'lspconfig.util' - return util.root_pattern 'Project.toml' (fname) or util.find_git_ancestor(fname) or - util.path.dirname(fname) - end, - }, - docs = { - description = [[ -TBW - ]], - }, -} From 4d44aa1a6da1983bea1af54aefd6b5d4f0c29695 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Sun, 31 Mar 2024 14:55:36 +0900 Subject: [PATCH 4/9] new: nvim: add none-ls --- dotfiles/neovim/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 9c46fd8..7c811d1 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -123,6 +123,12 @@ require('lazy').setup({ 'nvim-lua/plenary.nvim' }, }, + { + 'nvimtools/none-ls.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + }, { 'folke/trouble.nvim', -- config = function @@ -631,6 +637,14 @@ for _, ls in pairs(lss) do } end +-- none-ls +local null_ls = require('null-ls') +null_ls.setup { + sources = { + null_ls.builtins.diagnostics.fish, + } +} + -- nvim-cmp setup local cmp = require 'cmp' local luasnip = require 'luasnip' From 6fc88c3ad47de2b7a625d92ea44da7725ccc3506 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 2 Apr 2024 02:34:43 +0900 Subject: [PATCH 5/9] update: nvim: remove treesitter for org since now it's automatically loaded ref: https://github.com/nvim-orgmode/orgmode/releases/tag/0.3.1 --- dotfiles/neovim/init.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 7c811d1..064f243 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -184,9 +184,6 @@ require('lazy').setup({ }, -- event = 'VeryLazy', -- doesn't work with existing comp and treesitter config = function() - -- Load treesitter grammer for orgmode - require('orgmode').setup_ts_grammar() - -- Setup treesitter require('nvim-treesitter.configs').setup({ highlight = { From abf2a17474ec53e45687cde630e11613f695b20b Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 9 Apr 2024 08:47:08 +0900 Subject: [PATCH 6/9] nvim: new: add tree-sitter injection query for julia(md_str) --- bin/install.ps1 | 2 ++ bin/install.sh | 3 +++ bin/neovim/update_julials.jl | 5 ++++- dotfiles/neovim/after/queries/julia/injections.scm | 7 +++++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 dotfiles/neovim/after/queries/julia/injections.scm diff --git a/bin/install.ps1 b/bin/install.ps1 index 99e8f8e..bcc5fce 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -62,6 +62,8 @@ mkdir $env:LOCALAPPDATA\nvim\after\queries\satysfi Invoke-WebRequest -Uri "https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/highlights.scm" -OutFile $env:LOCALAPPDATA\nvim\after\queries\satysfi\highlights.scm Invoke-WebRequest -Uri "https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/indents.scm" -OutFile $env:LOCALAPPDATA\nvim\after\queries\satysfi\indents.scm Invoke-WebRequest -Uri "https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/matchup.scm" -OutFile $env:LOCALAPPDATA\nvim\after\queries\satysfi\matchup.scm +mkdir $env:LOCALAPPDATA\nvim\after\queries\julia +New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\nvim\after\queries\julia\injections.scm -Target (Resolve-Path .\dotfiles\neovim\after\queries\julia\injections.scm) # 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/bin/install.sh b/bin/install.sh index 357d8a0..09fca0c 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -25,6 +25,7 @@ ln -sf $(pwd)/dotfiles/neovim/init.lua ~/.config/nvim/init.lua mkdir -p ~/.config/nvim/lua ln -sf $(pwd)/dotfiles/neovim/lua/lualine_setup.lua ~/.config/nvim/lua/lualine_setup.lua ln -sf $(pwd)/dotfiles/neovim/lua/term_powershell.lua ~/.config/nvim/lua/term_powershell.lua +ln -sf $(pwd)/dotfiles/neovim/lua/pluto_nvim.lua ~/.config/nvim/lua/pluto_nvim.lua mkdir -p ~/.config/nvim/lua/lspconfig/server_configurations ln -sf $(pwd)/dotfiles/neovim/lua/lspconfig/server_configurations/satysfi_ls.lua ~/.config/nvim/lua/lspconfig/server_configurations/satysfi_ls.lua mkdir -p ~/.config/nvim/after/ftplugin @@ -34,6 +35,8 @@ mkdir -p ~/.config/nvim/after/queries/satysfi curl -o ~/.config/nvim/after/queries/satysfi/highlights.scm https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/highlights.scm curl -o ~/.config/nvim/after/queries/satysfi/indents.scm https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/indents.scm curl -o ~/.config/nvim/after/queries/satysfi/matchup.scm https://raw.githubusercontent.com/monaqa/tree-sitter-satysfi/master/queries/matchup.scm +mkdir -p ~/.config/nvim/after/queries/julia +ln -sf $(pwd)/dotfiles/neovim/after/queries/julia/injections.scm ~/.config/nvim/after/queries/julia/injections.scm mkdir -p ~/.config/nvim/luasnippets ln -sf $(pwd)/dotfiles/neovim/luasnippets/all.lua ~/.config/nvim/luasnippets/all.lua mkdir -p ~/.config/nvim/luasnippets/satysfi diff --git a/bin/neovim/update_julials.jl b/bin/neovim/update_julials.jl index ffb3e1f..935848c 100644 --- a/bin/neovim/update_julials.jl +++ b/bin/neovim/update_julials.jl @@ -3,7 +3,10 @@ project_path = joinpath(homedir(), ".julia", "environments", "nvim-lspconfig") cd(project_path) @info "now at " pwd() run(`julia --project=. -e 'using Pkg; Pkg.update()'`) -read("precompile_exec_head.jl", String) * read("tracecompile.jl", String) |> (b -> write("precompile_exec.jl", b)) +compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line + !startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) +end |> join +read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b)) @info "compiling sysimage..." run(`julia --project=. -e 'using PackageCompiler; create_sysimage(["LanguageServer"], sysimage_path = "sys-ls.so", precompile_execution_file = ["precompile_exec.jl"])'`) @info "post precompile" diff --git a/dotfiles/neovim/after/queries/julia/injections.scm b/dotfiles/neovim/after/queries/julia/injections.scm new file mode 100644 index 0000000..60d3f24 --- /dev/null +++ b/dotfiles/neovim/after/queries/julia/injections.scm @@ -0,0 +1,7 @@ +;; extends + +((prefixed_string_literal + prefix: (identifier) @_prefix) @injection.content + (#eq? @_prefix "md") + (#set! injection.language "markdown") + (#offset! @injection.content 0 2 0 -1)) From 00942d09b0b1c6a2bde121ad10b094781820beaa Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 9 Apr 2024 08:48:21 +0900 Subject: [PATCH 7/9] nvim: add: jsonls --- dotfiles/neovim/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 064f243..2b1b6b7 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -626,7 +626,7 @@ lspconfig.rust_analyzer.setup { } local lss = { "pyright", "texlab", "ccls", "clangd", "tsserver", --[["tailwindcss"]] "hls", "cmake", - "csharp_ls", "html", "r_language_server", "ruff_lsp", "cssls" } + "csharp_ls", "html", "r_language_server", "ruff_lsp", "cssls", "jsonls" } for _, ls in pairs(lss) do lspconfig[ls].setup { on_attach = on_attach, From cead8a4f4e1522c3d2ee75586318d1a99c508c26 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 9 Apr 2024 17:31:58 +0900 Subject: [PATCH 8/9] add: nvim: sqls --- dotfiles/neovim/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 2b1b6b7..8308575 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -626,7 +626,7 @@ lspconfig.rust_analyzer.setup { } local lss = { "pyright", "texlab", "ccls", "clangd", "tsserver", --[["tailwindcss"]] "hls", "cmake", - "csharp_ls", "html", "r_language_server", "ruff_lsp", "cssls", "jsonls" } + "csharp_ls", "html", "r_language_server", "ruff_lsp", "cssls", "jsonls", "sqls" } for _, ls in pairs(lss) do lspconfig[ls].setup { on_attach = on_attach, From 0340b930ea3c7e8963a70aa24c17ddde602e60ec Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 15 Apr 2024 18:00:06 +0900 Subject: [PATCH 9/9] update: nvim: remove auto appended setup script by PDM --- dotfiles/pwsh/powershell_profile.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dotfiles/pwsh/powershell_profile.ps1 b/dotfiles/pwsh/powershell_profile.ps1 index d7e9a0f..b9e0ae5 100644 --- a/dotfiles/pwsh/powershell_profile.ps1 +++ b/dotfiles/pwsh/powershell_profile.ps1 @@ -231,7 +231,3 @@ Import-Module WSLTabCompletion Get-ChildItem ~\.config\powershell\completions\ | % { . $_ } -# Automatically appended by pdm scoop package -Get-ChildItem "$PROFILE\..\Completions\" | ForEach-Object { - . $_.FullName -}