summaryrefslogtreecommitdiff
path: root/lua/lvim/core
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lvim/core')
-rw-r--r--lua/lvim/core/cmp.lua1
-rw-r--r--lua/lvim/core/telescope.lua21
-rw-r--r--lua/lvim/core/treesitter.lua13
3 files changed, 33 insertions, 2 deletions
diff --git a/lua/lvim/core/cmp.lua b/lua/lvim/core/cmp.lua
index 68c695cb..375f7605 100644
--- a/lua/lvim/core/cmp.lua
+++ b/lua/lvim/core/cmp.lua
@@ -169,6 +169,7 @@ M.config = function()
native_menu = false,
},
formatting = {
+ fields = { "kind", "abbr", "menu" },
kind_icons = {
Class = "ï – ",
Color = " ",
diff --git a/lua/lvim/core/telescope.lua b/lua/lvim/core/telescope.lua
index 7911d433..147c056c 100644
--- a/lua/lvim/core/telescope.lua
+++ b/lua/lvim/core/telescope.lua
@@ -2,12 +2,17 @@ local M = {}
function M.config()
-- Define this minimal config so that it's available if telescope is not yet available.
+
lvim.builtin.telescope = {
---@usage disable telescope completely [not recommeded]
active = true,
on_config_done = nil,
}
+ local ok, actions = pcall(require, "telescope.actions")
+ if not ok then
+ return
+ end
lvim.builtin.telescope = vim.tbl_extend("force", lvim.builtin.telescope, {
defaults = {
prompt_prefix = "ï‘« ",
@@ -33,6 +38,22 @@ function M.config()
"--smart-case",
"--hidden",
},
+ mappings = {
+ i = {
+ ["<C-n>"] = actions.move_selection_next,
+ ["<C-p>"] = actions.move_selection_previous,
+ ["<C-c>"] = actions.close,
+ ["<C-j>"] = actions.cycle_history_next,
+ ["<C-k>"] = actions.cycle_history_prev,
+ ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
+ ["<CR>"] = actions.select_default + actions.center,
+ },
+ n = {
+ ["<C-n>"] = actions.move_selection_next,
+ ["<C-p>"] = actions.move_selection_previous,
+ ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
+ },
+ },
file_ignore_patterns = {},
path_display = { shorten = 5 },
winblend = 0,
diff --git a/lua/lvim/core/treesitter.lua b/lua/lvim/core/treesitter.lua
index 9c6c555e..8dbbcacb 100644
--- a/lua/lvim/core/treesitter.lua
+++ b/lua/lvim/core/treesitter.lua
@@ -16,8 +16,17 @@ M.config = function()
disable = { "latex" },
},
context_commentstring = {
- enable = false,
- config = { css = "// %s" },
+ enable = true,
+ config = {
+ -- Languages that have a single comment style
+ typescript = "// %s",
+ css = "/* %s */",
+ scss = "/* %s */",
+ html = "<!-- %s -->",
+ svelte = "<!-- %s -->",
+ vue = "<!-- %s -->",
+ json = "",
+ },
},
-- indent = {enable = true, disable = {"python", "html", "javascript"}},
-- TODO seems to be broken