formatted init.lua

This commit is contained in:
qwjyh 2023-10-06 17:53:36 +09:00
parent 278f2b2261
commit 56b6f49a40

View file

@ -29,7 +29,7 @@ require('lazy').setup({
{ 'RRethy/vim-illuminate', }, -- highlight keywords under cursor { 'RRethy/vim-illuminate', }, -- highlight keywords under cursor
{ -- comment { -- comment
'numToStr/Comment.nvim', 'numToStr/Comment.nvim',
config = function () config = function()
require('Comment').setup() require('Comment').setup()
end, end,
}, },
@ -69,7 +69,8 @@ require('lazy').setup({
} }
end, end,
-- build process(make environments and add JET.jl) -- 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")']], 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', }, -- ft = { 'julia', },
}, },
{ {
@ -110,9 +111,9 @@ require('lazy').setup({
}, },
{ {
"andymass/vim-matchup", "andymass/vim-matchup",
config = function () config = function()
vim.g.matchup_matchparen_offscreen = { method = "popup" } vim.g.matchup_matchparen_offscreen = { method = "popup" }
require'nvim-treesitter.configs'.setup { require 'nvim-treesitter.configs'.setup {
matchup = { matchup = {
enable = true, enable = true,
} }
@ -180,10 +181,13 @@ vim.cmd.colorscheme "catppuccin"
----------------------------------------------------------- -----------------------------------------------------------
-- some terminalmode settings -- some terminalmode settings
vim.keymap.set('t', '<C-w>h', '<C-\\><C-N><C-w>h', { noremap = true, desc = "Exit terminal-mode and move to left window."}) vim.keymap.set('t', '<C-w>h', '<C-\\><C-N><C-w>h',
vim.keymap.set('t', '<C-w>j', '<C-\\><C-N><C-w>j', { noremap = true, desc = "Exit terminal-mode and move to down window."}) { noremap = true, desc = "Exit terminal-mode and move to left window." })
vim.keymap.set('t', '<C-w>k', '<C-\\><C-N><C-w>k', { noremap = true, desc = "Exit terminal-mode and move to up window."}) vim.keymap.set('t', '<C-w>j', '<C-\\><C-N><C-w>j',
vim.keymap.set('t', '<C-w>l', '<C-\\><C-N><C-w>l', { noremap = true, desc = "Exit terminal-mode and move to right window."}) { noremap = true, desc = "Exit terminal-mode and move to down window." })
vim.keymap.set('t', '<C-w>k', '<C-\\><C-N><C-w>k', { noremap = true, desc = "Exit terminal-mode and move to up window." })
vim.keymap.set('t', '<C-w>l', '<C-\\><C-N><C-w>l',
{ noremap = true, desc = "Exit terminal-mode and move to right window." })
----------------------------------------------------------- -----------------------------------------------------------
-- to use PowerShell on Windows -- to use PowerShell on Windows
@ -196,7 +200,8 @@ if vim.fn.has('win32') == 1 then
else else
vim.opt.shell = 'powershell' vim.opt.shell = 'powershell'
end end
vim.opt.shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;' vim.opt.shellcmdflag =
'-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait' vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
vim.opt.shellquote = '' vim.opt.shellquote = ''
@ -271,12 +276,12 @@ require('gitsigns').setup {
if vim.wo.diff then return ']c' end if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end) vim.schedule(function() gs.next_hunk() end)
return '<Ignore>' return '<Ignore>'
end, {expr=true}) end, { expr = true })
map('n', '[c', function() map('n', '[c', function()
if vim.wo.diff then return '[c' end if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end) vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>' return '<Ignore>'
end, {expr=true}) end, { expr = true })
end end
} }
@ -303,7 +308,7 @@ parser_config.satysfi = {
} }
-- setup -- setup
require'nvim-treesitter.configs'.setup { require 'nvim-treesitter.configs'.setup {
ensure_installed = { ensure_installed = {
'julia', 'julia',
'satysfi', 'satysfi',
@ -444,7 +449,7 @@ lspconfig.lua_ls.setup {
version = 'LuaJIT', version = 'LuaJIT',
}, },
diagnostics = { diagnostics = {
globals = {'vim'}, globals = { 'vim' },
}, },
workspace = { workspace = {
library = vim.api.nvim_get_runtime_file("", true), library = vim.api.nvim_get_runtime_file("", true),
@ -479,7 +484,7 @@ lspconfig.powershell_es.setup {
-- lspconfig.jetls.setup {} -- lspconfig.jetls.setup {}
-- ccls -- ccls
local lss = {"pyright", "rust_analyzer", "texlab", "ccls", "clangd", "tsserver", --[["tailwindcss"]] "hls", "cmake",} local lss = { "pyright", "rust_analyzer", "texlab", "ccls", "clangd", "tsserver", --[["tailwindcss"]] "hls", "cmake", }
for _, ls in pairs(lss) do for _, ls in pairs(lss) do
lspconfig[ls].setup { lspconfig[ls].setup {
on_attach = on_attach, on_attach = on_attach,
@ -494,7 +499,7 @@ luasnip.config.setup {
enable_autosnippets = true, enable_autosnippets = true,
store_selection_key = "<Tab>", store_selection_key = "<Tab>",
} }
require 'luasnip.loaders.from_lua'.load({paths = './luasnippets'}) require 'luasnip.loaders.from_lua'.load({ paths = './luasnippets' })
cmp.setup { cmp.setup {
snippet = { snippet = {