summaryrefslogtreecommitdiffstats
path: root/lua/conf/plugins
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lua/conf/plugins/biscuit.lua1
-rw-r--r--lua/conf/plugins/dressing.lua4
-rw-r--r--lua/conf/plugins/fidget.lua2
-rw-r--r--lua/conf/plugins/glance.lua44
-rw-r--r--lua/conf/plugins/incline.lua12
-rw-r--r--lua/conf/plugins/jdtls.lua143
-rw-r--r--lua/conf/plugins/leetcode.lua17
-rw-r--r--lua/conf/plugins/lsp_lines.lua13
-rw-r--r--lua/conf/plugins/lspconfig.lua18
-rw-r--r--lua/conf/plugins/luasnip.lua5
-rw-r--r--lua/conf/plugins/mason-lspconfig.lua273
-rw-r--r--lua/conf/plugins/mellow.lua8
-rw-r--r--lua/conf/plugins/smear.lua13
-rw-r--r--lua/conf/plugins/telescope.lua15
-rw-r--r--lua/conf/plugins/treesitter-context.lua40
-rw-r--r--lua/conf/plugins/treesitter.lua12
16 files changed, 223 insertions, 397 deletions
diff --git a/lua/conf/plugins/biscuit.lua b/lua/conf/plugins/biscuit.lua
deleted file mode 100644
index d5a1067..0000000
--- a/lua/conf/plugins/biscuit.lua
+++ /dev/null
@@ -1 +0,0 @@
-return { 'Biscuit-Theme/nvim' }
diff --git a/lua/conf/plugins/dressing.lua b/lua/conf/plugins/dressing.lua
index 64f9723..36622a6 100644
--- a/lua/conf/plugins/dressing.lua
+++ b/lua/conf/plugins/dressing.lua
@@ -12,9 +12,7 @@ return { 'stevearc/dressing.nvim',
function()
require('dressing').setup {
input = {
- title_pos = "center",
- border = 'solid',
- relative = "win"
+ enabled = false
}
}
end
diff --git a/lua/conf/plugins/fidget.lua b/lua/conf/plugins/fidget.lua
index 044f4ec..667c905 100644
--- a/lua/conf/plugins/fidget.lua
+++ b/lua/conf/plugins/fidget.lua
@@ -1,6 +1,6 @@
return { 'j-hui/fidget.nvim',
disable = vim.version().minor < 9,
- branch = "v1.4.5",
+ branch = "v1.5.0",
function()
local notification_defaults = require("fidget.notification").default_config
notification_defaults["icon"] = ""
diff --git a/lua/conf/plugins/glance.lua b/lua/conf/plugins/glance.lua
deleted file mode 100644
index c5a4d41..0000000
--- a/lua/conf/plugins/glance.lua
+++ /dev/null
@@ -1,44 +0,0 @@
-local misc = require('core.misc')
-local map = misc.map
-
-return { 'dnlhc/glance.nvim',
- disable = vim.version().minor < 7,
- function()
- require('glance').setup {
- border = {
- enable = true,
- top_char = '',
- bottom_char = '─',
- },
- folds = {
- fold_closed = '+',
- fold_open = '-',
- folded = true
- },
- theme = {
- enable = false
- },
- hooks = {
- before_open = function(results, open, jump, method)
- local uri = vim.uri_from_bufnr(0)
- if #results == 1 then
- local target_uri = results[1].uri or results[1].targetUri
-
- if target_uri == uri then
- jump()
- misc.timeout_highlight()
- return
- end
- end
-
- open()
- end
- }
- }
-
- map('n', 'gd', '<cmd>Glance definitions<CR>')
- map('n', 'gr', '<cmd>Glance references<CR>')
- map('n', 'gy', '<cmd>Glance type_definitions<CR>')
- map('n', 'gi', '<cmd>Glance implementations<CR>')
- end
-}
diff --git a/lua/conf/plugins/incline.lua b/lua/conf/plugins/incline.lua
deleted file mode 100644
index 3dab96d..0000000
--- a/lua/conf/plugins/incline.lua
+++ /dev/null
@@ -1,12 +0,0 @@
-return { 'b0o/incline.nvim',
- function()
- vim.cmd.set('laststatus=3')
-
- require('incline').setup {
- hide = {
- focused_win = true,
- cursorline = true
- }
- }
- end
-}
diff --git a/lua/conf/plugins/jdtls.lua b/lua/conf/plugins/jdtls.lua
index 6bbff1c..c847e5a 100644
--- a/lua/conf/plugins/jdtls.lua
+++ b/lua/conf/plugins/jdtls.lua
@@ -1,4 +1,145 @@
+local misc = require('core.misc')
+local lsp = require('core.lsp.functions')
+local map, auto = misc.map, misc.auto
+
return { 'mfussenegger/nvim-jdtls',
disable = vim.version().minor < 6,
- requires = 'mfussenegger/nvim-dap'
+ requires = 'mfussenegger/nvim-dap',
+ function()
+ auto("FileType", {
+ pattern = "java",
+ callback = function()
+ local jdtls = require('jdtls')
+ local jdtls_install = require('mason-registry').get_package('jdtls'):get_install_path()
+
+ -- make sure to check if things with 💀 need updating
+ local config = {
+ cmd = {
+ 'java', -- 💀
+ '-jar', vim.fn.glob(jdtls_install..'/plugins/org.eclipse.equinox.launcher_*.jar'), -- 💀
+ '-configuration', jdtls_install..'/config_linux',
+ '-data', vim.fn.stdpath('cache')..'/nvim-jdtls',
+
+ '--add-modules=ALL-SYSTEM',
+ '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
+ '--add-opens', 'java.base/java.util=ALL-UNNAMED',
+ '-Declipse.application=org.eclipse.jdt.ls.core.id1',
+ '-Declipse.product=org.eclipse.jdt.ls.core.product',
+ '-Dlog.level=ALL',
+ '-Dlog.protocol=true',
+ '-Dosgi.bundles.defaultStartLevel=4',
+ '-Xmx1G',
+ },
+ root_dir = vim.fs.dirname(vim.fs.find({
+ 'gradlew',
+ '.git',
+ 'mvnw',
+ 'build.xml'
+ }, { upward = true })[1]),
+
+ -- don't print out status messages
+ handlers = {
+ ['language/status'] = function() end
+ },
+
+ capabilities = lsp.capabilities(),
+ on_attach = function(client, bufnr)
+ lsp.attach(client, bufnr)
+
+ -- add some jdtls specific mappings
+ local opts = { buffer = bufnr }
+ map('n', 'cri', jdtls.organize_imports, opts)
+ map('n', 'crv', jdtls.extract_variable, opts)
+ map('n', 'crc', jdtls.extract_constant, opts)
+ map('x', 'crv', function() jdtls.extract_variable(true) end, opts)
+ map('x', 'crc', function() jdtls.extract_constant(true) end, opts)
+ map('x', 'crm', function() jdtls.extract_method(true) end, opts)
+
+ pcall(vim.lsp.codelens.refresh)
+ auto('BufWritePost', {
+ buffer = bufnr,
+ desc = 'refresh codelens',
+ callback = function()
+ pcall(vim.lsp.codelens.refresh)
+ end
+ })
+ end,
+ }
+
+ ---@type string|nil
+ local cache_path = vim.fs.joinpath(vim.fn.stdpath("cache"), "/JavaVersion.class")
+ ---@type string|nil
+ local src_path = vim.fs.joinpath(vim.fn.stdpath("config"), "/extras/JavaVersion.java")
+
+ -- if either path is invalid
+ if not cache_path or not src_path then
+ return
+ end
+
+ --- build a cache of the JavaVersion code
+ local function build_cache()
+ -- check if we have javac
+ vim.system({ "javac" }, {}, function(out)
+ if out.code == 127 then
+ cache_path = nil
+ return
+ end
+
+ -- compile our code
+ vim.system({ 'javac', src_path, '-d', vim.fn.stdpath("cache") }, {}, function(out)
+ if out.code ~= 0 then
+ cache_path = nil
+ end
+ end)
+ end)
+ end
+
+ -- check if we have a compiled version of JavaVersion
+ local f, _ = io.open(cache_path, "r")
+ if not f then -- if we don't have a cache
+ build_cache()
+ else
+ io.close(f)
+ end
+
+ -- check the java version
+ local buffer = {}
+ vim.fn.jobstart({
+ config.cmd[1],
+ (cache_path and "JavaVersion") or src_path
+ }, {
+ cwd = vim.fn.stdpath("cache"),
+ stdin = nil,
+ on_stdout = function(_, data, _)
+ table.insert(buffer, table.concat(data))
+ end,
+ on_exit = function(_, exit_code, _)
+ local v = vim.version.parse(table.concat(buffer))
+
+ -- if there's an error, no version info, or the java version is
+ -- less than 17 stop the lsp from starting
+ if exit_code ~= 0 then
+ vim.notify(string.format(
+ "java version check failed: exit code %s", exit_code),
+ vim.log.levels.ERROR, { title = misc.appid })
+ return
+ elseif not v then
+ vim.notify("no java version info found", vim.log.levels.ERROR,
+ { title = misc.appid })
+ return
+ elseif v.major < 17 then
+ vim.notify(string.format(
+ "java version %s < 17.0.0 Cannot run jdtls, bailing out",
+ v[1].."."..v[2].."."..v[3]),
+ vim.log.levels.ERROR, { title = misc.appid })
+ return
+ end
+
+ -- start lsp
+ jdtls.start_or_attach(config)
+ end
+ })
+ end
+ })
+ end
}
diff --git a/lua/conf/plugins/leetcode.lua b/lua/conf/plugins/leetcode.lua
new file mode 100644
index 0000000..bda7c08
--- /dev/null
+++ b/lua/conf/plugins/leetcode.lua
@@ -0,0 +1,17 @@
+return { 'kawre/leetcode.nvim',
+ requires = {
+ 'nvim-lua/plenary.nvim',
+ 'nvim-telescope/telescope.nvim',
+ 'MunifTanjim/nui.nvim',
+ 'nvim-treesitter/nvim-treesitter'
+ },
+ config = function()
+ -- because we're using treesitter make sure to install the html parser
+ vim.cmd.TSUpdate("html")
+ end,
+ function()
+ require('leetcode').setup {
+ lang = "java"
+ }
+ end
+}
diff --git a/lua/conf/plugins/lsp_lines.lua b/lua/conf/plugins/lsp_lines.lua
index 5f8e05d..e28aec8 100644
--- a/lua/conf/plugins/lsp_lines.lua
+++ b/lua/conf/plugins/lsp_lines.lua
@@ -1,12 +1,3 @@
-return { 'whynothugo/lsp_lines.nvim',
- url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
- requires = 'neovim/nvim-lspconfig',
- function()
- vim.diagnostic.config {
- virtual_lines = {
- highlight_whole_line = false,
- only_current_line = true
- }
- }
- end
+return { 'whynothugo/lsp_lines',
+ url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim'
}
diff --git a/lua/conf/plugins/lspconfig.lua b/lua/conf/plugins/lspconfig.lua
deleted file mode 100644
index 3dce638..0000000
--- a/lua/conf/plugins/lspconfig.lua
+++ /dev/null
@@ -1,18 +0,0 @@
-return { 'neovim/nvim-lspconfig',
- disable = vim.version().minor < 8,
- function()
- vim.diagnostic.config {
- virtual_text = false,
- signs = true,
- update_in_insert = false,
- underline = true,
- severity_sort = true
- }
-
- vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
- vim.lsp.handlers.hover, { border = 'solid' })
-
- vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
- vim.lsp.handlers.signature_help, { border = 'solid' })
- end
-}
diff --git a/lua/conf/plugins/luasnip.lua b/lua/conf/plugins/luasnip.lua
index 055fb02..d881a57 100644
--- a/lua/conf/plugins/luasnip.lua
+++ b/lua/conf/plugins/luasnip.lua
@@ -13,6 +13,7 @@ return { 'L3MON4D3/LuaSnip',
luasnip.config.set_config {
history = true, -- return back into snippet
+ enable_autosnippets = true,
-- update on text insert and cursor hold
updateevents = { "TextChanged", "TextChangedI", "CursorHold" },
@@ -26,8 +27,8 @@ return { 'L3MON4D3/LuaSnip',
active = {
virt_text = {{ "●", "@constant" }}
}
- },
- },
+ }
+ }
}
map({"i", "s"}, "<c-a>", function()
diff --git a/lua/conf/plugins/mason-lspconfig.lua b/lua/conf/plugins/mason-lspconfig.lua
index e746d5b..65c5693 100644
--- a/lua/conf/plugins/mason-lspconfig.lua
+++ b/lua/conf/plugins/mason-lspconfig.lua
@@ -1,74 +1,20 @@
local misc = require('core.misc')
+local lsp = require('core.lsp.functions')
local map, auto, augroup = misc.map, misc.auto, misc.augroup
return { 'williamboman/mason-lspconfig.nvim',
requires = {
'williamboman/mason.nvim',
- 'mfussenegger/nvim-jdtls',
- 'neovim/nvim-lspconfig'
+ { 'neovim/nvim-lspconfig',
+ disable = vim.version().minor < 8,
+ function()
+ lsp.setup()
+ end
+ }
},
function()
local util = require('lspconfig.util')
- -- configure lsp when attached
- local function lsp_attach(client, bufnr)
- -- helper function(s)
- local function set_lsp_sign(name, text)
- vim.fn.sign_define(name, { text = text, texthl = name })
- end
-
- set_lsp_sign("DiagnosticSignError", "x")
- set_lsp_sign("DiagnosticSignWarn" , "!")
- set_lsp_sign("DiagnosticSignInfo" , "i")
- set_lsp_sign("DiagnosticSignHint" , "h")
-
- local opts = { buffer = bufnr }
- -- LSP actions
- map('n', 'K', vim.lsp.buf.hover, opts)
- map('n', 'gD', vim.lsp.buf.definition, opts)
- -- map('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
- map('n', 'gI', vim.lsp.buf.implementation, opts)
- map('n', 'gY', vim.lsp.buf.type_definition, opts)
- map('n', 'gR', vim.lsp.buf.references, opts)
- map('n', '<S-Tab>', vim.lsp.buf.signature_help, opts)
- map('n', '<leader>lr', vim.lsp.buf.rename, opts)
- map('n', '<F2>', vim.lsp.buf.rename, opts)
- map('n', 'gA', vim.lsp.buf.code_action, {
- buffer = bufnr,
- desc = 'check code actions',
- })
- map('n', '<F4>', vim.lsp.buf.code_action, {
- buffer = bufnr,
- desc = 'check code actions'
- })
-
- -- Diagnostics
- map('n', '[d', vim.diagnostic.goto_prev)
- map('n', ']d', vim.diagnostic.goto_next)
- end
-
- -- setup lsp capabilities
- local capabilities = vim.lsp.protocol.make_client_capabilities()
- capabilities.textDocument.completion.completionItem = {
- documentationFormat = { "markdown", "plaintext" },
- snippetSupport = true,
- preselectSupport = true,
- insertReplaceSupport = true,
- labelDetailsSupport = true,
- deprecatedSupport = true,
- commitCharactersSupport = true,
- tagSupport = {
- valueSet = { 1 }
- },
- resolveSupport = {
- properties = {
- "documentation",
- "detail",
- "additionalTextEdits"
- }
- }
- }
-
-- setup language servers
require('mason-lspconfig').setup {
ensure_installed = {
@@ -86,8 +32,8 @@ return { 'williamboman/mason-lspconfig.nvim',
require('mason-lspconfig').setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
- on_attach = lsp_attach,
- capabilities = capabilities
+ on_attach = lsp.lsp_attach,
+ capabilities = lsp.capabilities()
}
end,
@@ -101,7 +47,8 @@ return { 'williamboman/mason-lspconfig.nvim',
-- FIXME: luals seems to start up twice and sends back twice the
-- completions (one configured with the below settings and one without)
require('lspconfig')[server_name].setup {
- on_attach = lsp_attach,
+ on_attach = lsp.attach,
+ capabilities = lsp.capabilities(),
settings = {
Lua = {
diagnostics = {
@@ -141,13 +88,13 @@ return { 'williamboman/mason-lspconfig.nvim',
["clangd"] = function(server_name)
require('lspconfig')[server_name].setup {
on_attach = function(client, bufnr)
- lsp_attach(client, bufnr)
+ lsp.attach(client, bufnr)
-- add some clangd specific mappings
local opts = { buffer = bufnr }
map("n", "<leader>o", "<cmd>ClangdSwitchSourceHeader<CR>", opts)
end,
- capabilities = capabilities,
+ capabilities = lsp.capabilities(),
cmd = {
"clangd",
@@ -168,197 +115,9 @@ return { 'williamboman/mason-lspconfig.nvim',
}
end,
- -- setup jdtls
- ["jdtls"] = function(server_name)
- auto("Filetype", {
- pattern = "java",
- callback = function()
- -- must be a java interpreter of version 17 or greater
- local java = "java"
-
- local buffer = {}
- ---@type function
- local startlsp
-
- -- check if version of java in use is high enough
- vim.fn.jobstart({ java, vim.fn.stdpath('config').."/extras/JavaVersion.java" }, {
- stdin = nil,
- on_stdout = function(_, data, _)
- table.insert(buffer, table.concat(data))
- end,
- on_exit = function(_, exit_code, _)
- local v = vim.version.parse(table.concat(buffer))
-
- -- if there's an error, no version info, or the java version is
- -- less than 17 stop the lsp from starting
- if exit_code ~= 0 then
- vim.notify(string.format(
- "java version check failed: exit code %s", exit_code),
- vim.log.levels.ERROR, { title = misc.appid })
- return
- elseif not v then
- vim.notify("no java version info found", vim.log.levels.ERROR,
- { title = misc.appid })
- return
- elseif v.major < 17 then
- vim.notify(string.format(
- "java version %s < 17.0.0 Cannot run jdtls, bailing out",
- v[1].."."..v[2].."."..v[3]),
- vim.log.levels.ERROR, { title = misc.appid })
- return
- end
-
- startlsp()
- end
- })
-
- function startlsp()
- local ok, jdtls = pcall(require, "jdtls")
- if not ok then
- vim.notify("jdtls not found, can't start java lsp",
- vim.log.levels.ERROR, {})
- return
- end
-
- local config = {}
-
- config.on_attach = function(client, bufnr)
- lsp_attach(client, bufnr)
-
- -- add some jdtls specific mappings
- local opts = { buffer = bufnr }
- map('n', 'cri', jdtls.organize_imports, opts)
- map('n', 'crv', jdtls.extract_variable, opts)
- map('n', 'crc', jdtls.extract_constant, opts)
- map('x', 'crv', "<esc><cmd>lua require('jdtls').extract_variable(true)<cr>", opts)
- map('x', 'crc', "<esc><cmd>lua require('jdtls').extract_constant(true)<cr>", opts)
- map('x', 'crm', "<esc><Cmd>lua require('jdtls').extract_method(true)<cr>", opts)
-
- -- refresh the codelens every time after writing the file
- local jdtls_cmds = augroup("jdtls_cmds")
-
- pcall(vim.lsp.codelens.refresh)
- auto('BufWritePost', {
- buffer = bufnr,
- group = jdtls_cmds,
- desc = 'refresh codelens',
- callback = function()
- pcall(vim.lsp.codelens.refresh)
- end
- })
- end
-
- -- setup path stuff
- local path = {}
- local jdtls_install = require('mason-registry').get_package('jdtls'):get_install_path()
- path.data_dir = vim.fn.stdpath('cache')..'/nvim-jdtls'
- path.java_agent = jdtls_install..'/lombok.jar'
- path.launcher_jar = vim.fn.glob(jdtls_install..'/plugins/org.eclipse.equinox.launcher_*.jar')
- path.platform_config = jdtls_install..'/config_linux'
- path.bundles = {}
-
- -- data dir
- local data_dir = path.data_dir..'/'..vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
-
- -- enable basic capabilities
- config.capabilities = capabilities
-
- -- enable some extended client capabilities
- local extendedClientCapabilities = jdtls.extendedClientCapabilities
- extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
-
- -- command to start the lsp server
- config.cmd = {
- java, -- this has to be java17 or newer
- '-Declipse.application=org.eclipse.jdt.ls.core.id1',
- '-Dosgi.bundles.defaultStartLevel=4',
- '-Declipse.product=org.eclipse.jdt.ls.core.product',
- '-Dlog.protocol=true',
- '-Dlog.level=ALL',
- '-Xmx1G',
- '--add-modules=ALL-SYSTEM',
- '--add-opens', 'java.base/java.util=ALL-UNNAMED',
- '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
- '-jar', path.launcher_jar,
- '-configuration', path.platform_config,
- '-data', data_dir
- }
-
- -- settings
- config.settings = {
- java = {
- eclipse = { downloadSources = true },
- gradle = { enabled = true },
- maven = { downloadSources = true },
- implementationsCodeLens = { enabled = true },
- referencesCodeLens = { enabled = true },
- references = { includeDecompiledSources = true },
- symbols = { includeSourceMethodDeclarations = true },
- inlayHints = {
- parameterNames = {
- enabled = "all"
- }
- },
- completion = {
- favoriteStaticMembers = {
- "org.hamcrest.MatcherAssert.assertThat",
- "org.hamcrest.Matchers.*",
- "org.hamcrest.CoreMatchers.*",
- "org.junit.jupiter.api.Assertions.*",
- "java.util.Objects.requireNonNull",
- "java.util.Objects.requireNonNullElse",
- "org.mockito.Mockito.*"
- },
- filteredTypes = {
- "com.sun.*",
- "io.micrometer.shaded.*",
- "java.awt.*",
- "jdk.*",
- "sun.*"
- },
- importOrder = {
- "java",
- "javax",
- "com",
- "org"
- }
- },
- sources = {
- organizeImports = {
- starThreshold = 9999,
- staticStarThreshold = 9999
- }
- },
- codeGeneration = {
- toString = {
- template = '${object.className}{${member.name()}=${member.value}, ${otherMembers}}'
- },
- hashCodeEquals = { useJava7Objects = true },
- useBlocks = true,
- }
- }
- }
- config.signatureHelp = { enabled = true }
- config.flags = { allow_incremental_sync = true }
-
- -- disable all messages from printing
- config.handlers = {
- ['language/status'] = function() end
- }
-
- config.init_options = {
- extendedClientCapabilities = extendedClientCapabilities,
- }
-
- config.root_dir = vim.fs.root(0, { ".git", "mvnw", ".gradle",
- "gradlew", "build.xml" })
-
- -- start it up
- jdtls.start_or_attach(config)
- end
- end
- })
- end
+ -- disable it, we start this using nvim-jdtls
+ ["jdtls"] = function(_) end
}
+
end
}
diff --git a/lua/conf/plugins/mellow.lua b/lua/conf/plugins/mellow.lua
index af805ed..11103ae 100644
--- a/lua/conf/plugins/mellow.lua
+++ b/lua/conf/plugins/mellow.lua
@@ -1,4 +1,5 @@
return { 'mellow-theme/mellow.nvim',
+ disable = vim.version().minor < 8,
requires = 'nvim-treesitter/nvim-treesitter',
function()
vim.g.mellow_variant = "dark"
@@ -29,7 +30,12 @@ return { 'mellow-theme/mellow.nvim',
["@neorg.headings.5.icon"] = { link = "@neorg.headings.5.title" },
["@neorg.headings.6.title"] = { fg = c.white, bg = '#212126' },
- ["@neorg.headings.6.icon"] = { link = "@neorg.headings.6.title" }
+ ["@neorg.headings.6.icon"] = { link = "@neorg.headings.6.title" },
+
+ -- make blink actually look nice
+ ["BlinkCmpMenu"] = { bg = c.bg_dark },
+ ["BlinkCmpMenuBorder"] = { link = "BlinkCmpMenu" },
+ ["BlinkCmpMenuSelection"] = { bg = c.gray02 }
}
end
}
diff --git a/lua/conf/plugins/smear.lua b/lua/conf/plugins/smear.lua
new file mode 100644
index 0000000..4e0e051
--- /dev/null
+++ b/lua/conf/plugins/smear.lua
@@ -0,0 +1,13 @@
+-- yea it's a bit flashy, but it's genuenly useful to be able to tell where my
+-- cursor has gone
+return { 'sphamba/smear-cursor.nvim',
+ disable = vim.version.lt(vim.version(), { 0, 10, 2 }) or vim.g.neovide_version,
+ function()
+ require('smear_cursor').setup {
+ stiffness = 0.8, -- 0.6 [0, 1]
+ trailing_stiffness = 0.5, -- 0.3 [0, 1]
+ distance_stop_animating = 0.5, -- 0.1 > 0
+ hide_target_hack = false -- true boolean
+ }
+ end
+}
diff --git a/lua/conf/plugins/telescope.lua b/lua/conf/plugins/telescope.lua
index 68a7c23..597fbe3 100644
--- a/lua/conf/plugins/telescope.lua
+++ b/lua/conf/plugins/telescope.lua
@@ -76,6 +76,21 @@ return { 'nvim-telescope/telescope.nvim',
map('n', '<leader>b', telebuilt.current_buffer_fuzzy_find, {
desc = 'Find string in current buffer.',
})
+ map('n', '<leader>i', telebuilt.help_tags, {
+ desc = 'Fuzzy find over help tags.',
+ })
+
+ -- find over specific directories
+ map('n', '<leader>tc', function()
+ require('telescope.builtin').find_files {
+ cwd = vim.fn.stdpath("config")
+ }
+ end, { desc = "Fuzzy find over files in my config" })
+ map('n', '<leader>tp', function()
+ require('telescope.builtin').find_files {
+ cwd = vim.fs.joinpath(vim.fn.stdpath("data"), "site/pack/deps/opt")
+ }
+ end, { desc = "Fuzzy find over files in my plugin directory" })
-- enable previewing in the default colorscheme switcher
telebuilt.colorscheme = function()
diff --git a/lua/conf/plugins/treesitter-context.lua b/lua/conf/plugins/treesitter-context.lua
deleted file mode 100644
index 3306e6b..0000000
--- a/lua/conf/plugins/treesitter-context.lua
+++ /dev/null
@@ -1,40 +0,0 @@
-local misc = require("core.misc")
-local map = misc.map
-
-local branch = nil
-if vim.version().minor == 7 then
- branch = 'compat/0.7'
-end
-
-return { 'nvim-treesitter/nvim-treesitter-context',
- disable = vim.version().minor < 7,
- branch = branch,
- requires = 'nvim-treesitter/nvim-treesitter',
- function()
- local treesitter_context = require("treesitter-context")
-
- treesitter_context.setup {
- enable = true,
- line_numbers = true,
- separator = '─',
- }
-
- -- mapping to jump to the first closest line of context in buffer
- map("n", "[j", function()
- local lline = vim.api.nvim_win_get_cursor(0)[1];
- local line
-
- -- go to the first closest line of context and center it
- treesitter_context.go_to_context()
- vim.api.nvim_input('zz')
-
- -- make sure we actually moved
- line = vim.api.nvim_win_get_cursor(0)[1];
- if line == lline then
- return
- end
-
- misc.timeout_highlight()
- end)
- end
-}
diff --git a/lua/conf/plugins/treesitter.lua b/lua/conf/plugins/treesitter.lua
index a81e295..4f010d9 100644
--- a/lua/conf/plugins/treesitter.lua
+++ b/lua/conf/plugins/treesitter.lua
@@ -8,7 +8,7 @@ table.contains = function(self, string)
end
return { 'nvim-treesitter/nvim-treesitter',
- disable = vim.version.lt(vim.version(), { 0, 9, 2 }),
+ disable = vim.version().minor < 10,
config = function()
vim.cmd.TSUpdate()
end,
@@ -24,11 +24,11 @@ return { 'nvim-treesitter/nvim-treesitter',
indent = {
enable = true,
- disable = function(lang, buf)
+ disable = function(lang, _)
-- disable indenting in php (it's more broken with than without)
- return table.contains({
+ return table.contains(({
"php"
- }, lang)
+ }), lang)
end
},
@@ -40,9 +40,9 @@ return { 'nvim-treesitter/nvim-treesitter',
disable = function(lang, buf)
-- disable in some files where vim's builtin highlighting is better
- if table.contains({
+ if table.contains(({
"diff", "tex"
- }, lang) then
+ }), lang) then
return true
end