treesitter: indent config
This commit is contained in:
parent
0d7e357c3f
commit
301dab336e
5 changed files with 110 additions and 97 deletions
|
@ -63,36 +63,36 @@ for _, lsp in ipairs(servers) do
|
|||
end
|
||||
|
||||
local efm_prettier = {
|
||||
formatCommand = "prettier --stdin-filepath ${INPUT}",
|
||||
formatStdin = true
|
||||
formatCommand = "prettier --stdin-filepath ${INPUT}",
|
||||
formatStdin = true
|
||||
}
|
||||
|
||||
|
||||
lspconfig.sumneko_lua.setup {
|
||||
cmd = {"lua-language-server", "-E", "/usr/share/lua-language-server/main.lua"},
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {kewordSnippet = "Disable"},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
globals = {"renoise", "use", "vim"}
|
||||
},
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = {"?.lua", "?/init.lua", "?/?.lua"}
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
[vim.fn.stdpath("data") .. "/site/pack"] = true
|
||||
},
|
||||
maxPreload = 2000,
|
||||
preloadFileSize = 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
cmd = {"lua-language-server", "-E", "/usr/share/lua-language-server/main.lua"},
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {kewordSnippet = "Disable"},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
globals = {"renoise", "use", "vim"}
|
||||
},
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = {"?.lua", "?/init.lua", "?/?.lua"}
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
[vim.fn.stdpath("data") .. "/site/pack"] = true
|
||||
},
|
||||
maxPreload = 2000,
|
||||
preloadFileSize = 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.yamlls.setup {
|
||||
|
|
|
@ -1,73 +1,78 @@
|
|||
require("nvim-treesitter.configs").setup {
|
||||
ensure_installed = "maintained",
|
||||
highlight = {enable = true},
|
||||
playground = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
updatetime = 25,
|
||||
persist_queries = false
|
||||
},
|
||||
ensure_installed = "maintained",
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
},
|
||||
|
||||
incremental_selection = {
|
||||
|
||||
playground = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
updatetime = 25,
|
||||
persist_queries = false
|
||||
},
|
||||
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "ss",
|
||||
node_incremental = "sq",
|
||||
scope_incremental = "sd",
|
||||
node_decremental = "sa",
|
||||
},
|
||||
},
|
||||
|
||||
textobjects = {
|
||||
move = {
|
||||
enable = true,
|
||||
goto_next_start = {
|
||||
["]]"] = "@function.outer",
|
||||
["]m"] = "@class.outer"
|
||||
},
|
||||
goto_next_end = {
|
||||
["]["] = "@function.outer",
|
||||
["]M"] = "@class.outer"
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[["] = "@function.outer",
|
||||
["[m"] = "@class.outer"
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[]"] = "@function.outer",
|
||||
["[M"] = "@class.outer"
|
||||
}
|
||||
},
|
||||
select = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "ss",
|
||||
node_incremental = "sq",
|
||||
scope_incremental = "sd",
|
||||
node_decremental = "sa",
|
||||
},
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
-- Or you can define your own textobjects like this
|
||||
["iF"] = {
|
||||
python = "(function_definition) @function",
|
||||
cpp = "(function_definition) @function",
|
||||
c = "(function_definition) @function",
|
||||
java = "(method_declaration) @function"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
textobjects = {
|
||||
move = {
|
||||
enable = true,
|
||||
goto_next_start = {
|
||||
["]]"] = "@function.outer",
|
||||
["]m"] = "@class.outer"
|
||||
},
|
||||
goto_next_end = {
|
||||
["]["] = "@function.outer",
|
||||
["]M"] = "@class.outer"
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[["] = "@function.outer",
|
||||
["[m"] = "@class.outer"
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[]"] = "@function.outer",
|
||||
["[M"] = "@class.outer"
|
||||
}
|
||||
},
|
||||
select = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
-- Or you can define your own textobjects like this
|
||||
["iF"] = {
|
||||
python = "(function_definition) @function",
|
||||
cpp = "(function_definition) @function",
|
||||
c = "(function_definition) @function",
|
||||
java = "(method_declaration) @function"
|
||||
}
|
||||
}
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>l"] = "@parameter.inner"
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>h"] = "@parameter.inner"
|
||||
}
|
||||
}
|
||||
},
|
||||
--- nvim-ts-autotag ---
|
||||
autotag = {
|
||||
enable = true,
|
||||
filetypes = {"html", "javascriptreact", "xml"}
|
||||
}
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>l"] = "@parameter.inner"
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>h"] = "@parameter.inner"
|
||||
}
|
||||
}
|
||||
},
|
||||
--- nvim-ts-autotag ---
|
||||
autotag = {
|
||||
enable = true,
|
||||
filetypes = {"html", "javascriptreact", "xml"}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,9 +21,9 @@ vim.o.listchars = 'extends:›,precedes:‹,nbsp:·,tab:→ ,trail:·'
|
|||
vim.wo.foldlevel = 99
|
||||
vim.wo.linebreak = true
|
||||
vim.wo.list = true
|
||||
vim.o.shiftwidth = 4
|
||||
vim.o.tabstop = 4
|
||||
vim.o.softtabstop = 4
|
||||
vim.o.shiftwidth = 2
|
||||
vim.o.tabstop = 2
|
||||
vim.o.softtabstop = 2
|
||||
|
||||
--- Search
|
||||
vim.cmd('set path+=**')
|
||||
|
|
|
@ -42,6 +42,7 @@ return require('packer').startup(function()
|
|||
end
|
||||
end
|
||||
|
||||
utils.mapx("is", "<C-space>", "v:lua.complete('<C-n>', '<Tab>')")
|
||||
utils.mapx("is", "<Tab>", "v:lua.complete('<C-n>', '<Tab>')")
|
||||
utils.mapx("is", "<S-Tab>", "v:lua.complete('<C-p>', '<C-h>')")
|
||||
utils.mapx("x", "<CR>", "compe:#confirm('<CR')")
|
||||
|
@ -57,6 +58,13 @@ return require('packer').startup(function()
|
|||
config = function()
|
||||
require('gitsigns').setup {
|
||||
numhl = true,
|
||||
signs = {
|
||||
add = {hl = 'GitSignsAdd' , text = '▌', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
|
||||
change = {hl = 'GitSignsChange', text = '▌', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||
delete = {hl = 'GitSignsDelete', text = '▖', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||
topdelete = {hl = 'GitSignsDelete', text = '▘', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||
},
|
||||
}
|
||||
end
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[core]
|
||||
excludesfile = "~/.gitignore"
|
||||
pager = delta --line-numbers -s
|
||||
pager = delta --line-numbers
|
||||
|
||||
[user]
|
||||
useConfigOnly = true
|
||||
|
|
Loading…
Reference in a new issue