Increase godot LS debounce and reformat lua files
parent
fabad863a1
commit
0d2cd042d9
|
@ -1,4 +1,4 @@
|
|||
require('lsp.jdtls_setup').setup()
|
||||
require("lsp.jdtls_setup").setup()
|
||||
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.tabstop = 4
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
if require('init.first_load')() then
|
||||
if require("init.first_load")() then
|
||||
return
|
||||
end
|
||||
|
||||
-- Allow `require('impatient')` to fail, in case plugins are not yet installed
|
||||
_ = pcall(require, 'impatient')
|
||||
_ = pcall(require, "impatient")
|
||||
|
||||
vim.cmd [[filetype plugin indent on]]
|
||||
|
||||
|
@ -13,33 +13,33 @@ vim.api.nvim_exec('let $NVIMHOME = $HOME."/.local/share/nvim"', false)
|
|||
vim.api.nvim_exec('let $VIMPLUGINS = expand($VIMHOME."/lua/personal/plugins.lua")', false)
|
||||
|
||||
-- Leader config to <Space>
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Globals taken from TJ config
|
||||
-- Helpful for configuration
|
||||
-- Might be removed in future version of NeoVim
|
||||
require('init.globals')
|
||||
require("init.globals")
|
||||
|
||||
require('init.plugins')
|
||||
require("init.plugins")
|
||||
|
||||
require('init.options')
|
||||
require("init.options")
|
||||
|
||||
require('lsp')
|
||||
require("lsp")
|
||||
|
||||
-- Colorscheme
|
||||
vim.cmd('syntax on')
|
||||
require('init.colors')
|
||||
vim.cmd("syntax on")
|
||||
require("init.colors")
|
||||
|
||||
vim.api.nvim_set_keymap('n', 'Q', 'gq', {})
|
||||
vim.api.nvim_set_keymap('i', '<C-U>', '<C-G>u<C-U>', {noremap = true})
|
||||
vim.api.nvim_set_keymap("n", "Q", "gq", {})
|
||||
vim.api.nvim_set_keymap("i", "<C-U>", "<C-G>u<C-U>", {noremap = true})
|
||||
|
||||
vim.cmd('command! Wq :wq')
|
||||
vim.cmd('command! W :w')
|
||||
vim.cmd("command! Wq :wq")
|
||||
vim.cmd("command! W :w")
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<Leader>c', ':ccl <bar> lcl<CR>', {noremap = true})
|
||||
vim.api.nvim_set_keymap("n", "<Leader>c", ":ccl <bar> lcl<CR>", {noremap = true})
|
||||
|
||||
-- Allow recursive searches
|
||||
vim.cmd('set path+=**')
|
||||
vim.cmd("set path+=**")
|
||||
|
||||
-- automatically rebalance windows on vim resize
|
||||
vim.cmd('autocmd VimResized * :wincmd =')
|
||||
vim.cmd("autocmd VimResized * :wincmd =")
|
||||
|
|
|
@ -7,28 +7,26 @@
|
|||
-- Works regardless of ssh or https for origin config
|
||||
-- Hardcoded to use 'origin' remote
|
||||
local function get_pr_url(...)
|
||||
local origin_url = vim.fn['fugitive#RemoteUrl']('origin')
|
||||
origin_url = string.gsub(origin_url, '.git$', '')
|
||||
origin_url = string.gsub(origin_url, ':', '/')
|
||||
origin_url = string.gsub(origin_url, 'git@', 'https://')
|
||||
local origin_url = vim.fn["fugitive#RemoteUrl"]("origin")
|
||||
origin_url = string.gsub(origin_url, ".git$", "")
|
||||
origin_url = string.gsub(origin_url, ":", "/")
|
||||
origin_url = string.gsub(origin_url, "git@", "https://")
|
||||
|
||||
-- Remove prefix if it is available, for some of common git services
|
||||
local common_services = {'github.com', 'bitbucket.org', 'gitlab.com'}
|
||||
for k,service in pairs(common_services) do
|
||||
if (string.find(origin_url, service, 1, true))
|
||||
then
|
||||
local common_services = {"github.com", "bitbucket.org", "gitlab.com"}
|
||||
for k, service in pairs(common_services) do
|
||||
if (string.find(origin_url, service, 1, true)) then
|
||||
-- Common mechanism for managing multiple SSH keys
|
||||
origin_url = string.gsub(origin_url, '://.*' .. service, '://' .. service)
|
||||
origin_url = string.gsub(origin_url, "://.*" .. service, "://" .. service)
|
||||
end
|
||||
end
|
||||
|
||||
-- This part probably only works on github
|
||||
local pr_url
|
||||
if (select('#', ...) == 0)
|
||||
then
|
||||
pr_url = origin_url .. '/compare/' .. vim.fn.FugitiveHead() .. '?expand=1'
|
||||
if (select("#", ...) == 0) then
|
||||
pr_url = origin_url .. "/compare/" .. vim.fn.FugitiveHead() .. "?expand=1"
|
||||
else
|
||||
pr_url = origin_url .. '/compare/' .. select(1, ...) .. '...' .. vim.fn.FugitiveHead() .. '?expand=1'
|
||||
pr_url = origin_url .. "/compare/" .. select(1, ...) .. "..." .. vim.fn.FugitiveHead() .. "?expand=1"
|
||||
end
|
||||
return pr_url
|
||||
end
|
||||
|
@ -42,16 +40,15 @@ local M = {}
|
|||
-- Shorcut to push directly to current branch on origin
|
||||
-- Similar to `ggpush` in fish config
|
||||
function M.push_origin()
|
||||
vim.cmd('Git push origin ' .. vim.fn.FugitiveHead())
|
||||
vim.cmd("Git push origin " .. vim.fn.FugitiveHead())
|
||||
end
|
||||
|
||||
-- Shorcut to pull directly from current branch on origin
|
||||
-- Similar to `ggpull` in fish config
|
||||
function M.pull_origin()
|
||||
vim.cmd('Git pull origin ' .. vim.fn.FugitiveHead())
|
||||
vim.cmd("Git pull origin " .. vim.fn.FugitiveHead())
|
||||
end
|
||||
|
||||
|
||||
-- Prints current branches PR url (not saved to :messages)
|
||||
-- Makes it easy to use terminal for opening url on click
|
||||
function M.print_pr_url(...)
|
||||
|
@ -66,18 +63,18 @@ end
|
|||
-- Opens current banches PR url in default browser
|
||||
-- Utilizes netrw browse, meaning it should behave same as netrw
|
||||
function M.open_new_pr(...)
|
||||
vim.fn['netrw#BrowseX'](get_pr_url(...), 0)
|
||||
vim.fn["netrw#BrowseX"](get_pr_url(...), 0)
|
||||
end
|
||||
|
||||
-- Creates new branch and checks out to it
|
||||
-- Similar to `gcb` in fish config
|
||||
function M.create_branch(branch)
|
||||
vim.cmd('Git checkout -b ' .. branch)
|
||||
vim.cmd("Git checkout -b " .. branch)
|
||||
end
|
||||
|
||||
-- Switches to branch
|
||||
function M.checkout_branch(branch)
|
||||
vim.cmd('Git checkout ' .. branch)
|
||||
vim.cmd("Git checkout " .. branch)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -4,28 +4,24 @@ local download_packer = function()
|
|||
return
|
||||
end
|
||||
|
||||
local directory = string.format(
|
||||
'%s/site/pack/packer/start/',
|
||||
vim.fn.stdpath('data')
|
||||
local directory = string.format("%s/site/pack/packer/start/", vim.fn.stdpath("data"))
|
||||
|
||||
vim.fn.mkdir(directory, "p")
|
||||
|
||||
local out =
|
||||
vim.fn.system(
|
||||
string.format("git clone %s %s", "https://github.com/wbthomason/packer.nvim", directory .. "/packer.nvim")
|
||||
)
|
||||
|
||||
vim.fn.mkdir(directory, 'p')
|
||||
|
||||
local out = vim.fn.system(string.format(
|
||||
'git clone %s %s',
|
||||
'https://github.com/wbthomason/packer.nvim',
|
||||
directory .. '/packer.nvim'
|
||||
))
|
||||
|
||||
print(out)
|
||||
print("Downloading packer.nvim...")
|
||||
vim.api.nvim_command('PackerCompile')
|
||||
vim.api.nvim_command('PackerInstall')
|
||||
vim.api.nvim_command("PackerCompile")
|
||||
vim.api.nvim_command("PackerInstall")
|
||||
print("( You'll need to restart now )")
|
||||
end
|
||||
|
||||
return function()
|
||||
if not pcall(require, 'packer') then
|
||||
if not pcall(require, "packer") then
|
||||
download_packer()
|
||||
|
||||
return true
|
||||
|
|
|
@ -6,8 +6,8 @@ P = function(v)
|
|||
return v
|
||||
end
|
||||
|
||||
if pcall(require, 'plenary') then
|
||||
RELOAD = require('plenary.reload').reload_module
|
||||
if pcall(require, "plenary") then
|
||||
RELOAD = require("plenary.reload").reload_module
|
||||
|
||||
R = function(name)
|
||||
RELOAD(name)
|
||||
|
@ -16,4 +16,4 @@ if pcall(require, 'plenary') then
|
|||
end
|
||||
|
||||
-- `vim.opt`
|
||||
require('init.globals.opt')
|
||||
require("init.globals.opt")
|
||||
|
|
|
@ -12,7 +12,6 @@ set_opts {
|
|||
}
|
||||
|
||||
--]]
|
||||
|
||||
--[[ Global option names
|
||||
|
||||
For those wondering how to get the values at the top level,
|
||||
|
@ -26,7 +25,6 @@ setfenv(function()
|
|||
end, vim.opt)()
|
||||
|
||||
--]]
|
||||
|
||||
local if_nil = function(a, b)
|
||||
if a == nil then
|
||||
return b
|
||||
|
@ -35,9 +33,9 @@ local if_nil = function(a, b)
|
|||
end
|
||||
|
||||
local singular_values = {
|
||||
['boolean'] = true,
|
||||
['number'] = true,
|
||||
['nil'] = true,
|
||||
["boolean"] = true,
|
||||
["number"] = true,
|
||||
["nil"] = true
|
||||
}
|
||||
|
||||
local set_key_value = function(t, key_value_str)
|
||||
|
@ -52,7 +50,7 @@ end
|
|||
|
||||
local convert_vimoption_to_lua = function(option, val)
|
||||
-- Short circuit if we've already converted!
|
||||
if type(val) == 'table' then
|
||||
if type(val) == "table" then
|
||||
return val
|
||||
end
|
||||
|
||||
|
@ -83,7 +81,7 @@ end
|
|||
local concat_key_values = function(t, sep, divider)
|
||||
local final = {}
|
||||
for k, v in pairs(t) do
|
||||
table.insert(final, string.format('%s%s%s', k, divider, v))
|
||||
table.insert(final, string.format("%s%s%s", k, divider, v))
|
||||
end
|
||||
|
||||
table.sort(final)
|
||||
|
@ -121,14 +119,12 @@ end
|
|||
local add_value = function(current, new)
|
||||
if singular_values[type(current)] then
|
||||
error(
|
||||
"This is not possible to do. Please do something different: "
|
||||
.. tostring(current)
|
||||
.. " // "
|
||||
.. tostring(new)
|
||||
"This is not possible to do. Please do something different: " ..
|
||||
tostring(current) .. " // " .. tostring(new)
|
||||
)
|
||||
end
|
||||
|
||||
if type(new) == 'string' then
|
||||
if type(new) == "string" then
|
||||
if vim.tbl_islist(current) then
|
||||
table.insert(current, new)
|
||||
else
|
||||
|
@ -136,7 +132,7 @@ local add_value = function(current, new)
|
|||
end
|
||||
|
||||
return current
|
||||
elseif type(new) == 'table' then
|
||||
elseif type(new) == "table" then
|
||||
if vim.tbl_islist(current) then
|
||||
assert(vim.tbl_islist(new))
|
||||
vim.list_extend(current, new)
|
||||
|
@ -156,9 +152,9 @@ local convert_lua_to_vimoption = function(t)
|
|||
t = remove_duplicate_values(t)
|
||||
|
||||
table.sort(t)
|
||||
return table.concat(t, ',')
|
||||
return table.concat(t, ",")
|
||||
else
|
||||
return concat_key_values(t, ',', ':')
|
||||
return concat_key_values(t, ",", ":")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -167,7 +163,7 @@ local clean_value = function(v)
|
|||
return v
|
||||
end
|
||||
|
||||
local result = v:gsub('^,', '')
|
||||
local result = v:gsub("^,", "")
|
||||
|
||||
return result
|
||||
end
|
||||
|
@ -176,19 +172,18 @@ local opt_mt
|
|||
|
||||
opt_mt = {
|
||||
__index = function(t, k)
|
||||
if k == '_value' then
|
||||
if k == "_value" then
|
||||
return rawget(t, k)
|
||||
end
|
||||
|
||||
return setmetatable({ _option = k, }, opt_mt)
|
||||
return setmetatable({_option = k}, opt_mt)
|
||||
end,
|
||||
|
||||
__newindex = function(t, k, v)
|
||||
if k == '_value' then
|
||||
if k == "_value" then
|
||||
return rawset(t, k, v)
|
||||
end
|
||||
|
||||
if type(v) == 'table' then
|
||||
if type(v) == "table" then
|
||||
local new_value
|
||||
if getmetatable(v) ~= opt_mt then
|
||||
new_value = v
|
||||
|
@ -202,12 +197,12 @@ opt_mt = {
|
|||
end
|
||||
|
||||
if v == nil then
|
||||
v = ''
|
||||
v = ""
|
||||
end
|
||||
|
||||
-- TODO: Figure out why nvim_set_option doesn't override values the same way.
|
||||
-- @bfredl said he will fix this for me, so I can just use nvim_set_option
|
||||
if type(v) == 'boolean' then
|
||||
if type(v) == "boolean" then
|
||||
vim.o[k] = clean_value(v)
|
||||
if v then
|
||||
vim.cmd(string.format("set %s", k))
|
||||
|
@ -218,15 +213,13 @@ opt_mt = {
|
|||
vim.cmd(string.format("set %s=%s", k, clean_value(v)))
|
||||
end
|
||||
end,
|
||||
|
||||
__add = function(left, right)
|
||||
--[[
|
||||
set.wildignore = set.wildignore + 'hello'
|
||||
set.wildignore = set.wildignore + { '*.o', '*~', }
|
||||
--]]
|
||||
|
||||
assert(left._option, "must have an option key")
|
||||
if left._option == 'foldcolumn' then
|
||||
if left._option == "foldcolumn" then
|
||||
error("not implemented for foldcolumn.. use a string")
|
||||
end
|
||||
|
||||
|
@ -239,7 +232,6 @@ opt_mt = {
|
|||
left._value = add_value(current, right)
|
||||
return left
|
||||
end,
|
||||
|
||||
__sub = function(left, right)
|
||||
assert(left._option, "must have an option key")
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
local opt = vim.opt
|
||||
|
||||
opt.wildignore = '__pycache__'
|
||||
opt.wildignore = opt.wildignore + { '*.o' , '*~', '*.pyc', '*pycache*' }
|
||||
opt.wildignore = "__pycache__"
|
||||
opt.wildignore = opt.wildignore + {"*.o", "*~", "*.pyc", "*pycache*"}
|
||||
|
||||
-- Indentation config
|
||||
opt.tabstop = 2
|
||||
|
@ -14,7 +14,7 @@ opt.number = true
|
|||
opt.relativenumber = true
|
||||
|
||||
-- Misc
|
||||
opt.backspace = 'indent,eol,start' -- Allow backspacing over everything in insert mode
|
||||
opt.backspace = "indent,eol,start" -- Allow backspacing over everything in insert mode
|
||||
opt.ttimeoutlen = 50
|
||||
opt.backup = false -- do not keep a backup file, use versions instead
|
||||
opt.history = 50 -- Keep 50 lines of command line history
|
||||
|
@ -26,8 +26,8 @@ opt.showcmd = true -- Display incomplete commands
|
|||
opt.incsearch = true -- Do incremental searching
|
||||
opt.autoread = true -- Reload files changed outside
|
||||
opt.hidden = true -- Allow leaving unsaved buffers
|
||||
opt.inccommand = 'nosplit' -- Enable live preview of text replacement
|
||||
opt.inccommand = "nosplit" -- Enable live preview of text replacement
|
||||
opt.hlsearch = true
|
||||
opt.mouse = 'a'
|
||||
opt.mouse = "a"
|
||||
|
||||
opt.encoding = "utf-8"
|
||||
|
|
|
@ -1,107 +1,105 @@
|
|||
return require('packer').startup {
|
||||
return require("packer").startup {
|
||||
function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use "wbthomason/packer.nvim"
|
||||
|
||||
-- Tpope general improvements --
|
||||
use 'tpope/vim-sensible' -- Sane defaults
|
||||
use 'tpope/vim-endwise' -- Add closing statements automatically for if, function etc
|
||||
use 'tpope/vim-surround' -- Surround with ', ", etc
|
||||
use 'tpope/vim-fugitive' -- Git integration
|
||||
use 'tpope/vim-vinegar' -- Netrw improvements
|
||||
use 'tpope/vim-obsession' -- Session.vim management
|
||||
use 'tpope/vim-dadbod' -- Database access
|
||||
use 'kristijanhusak/vim-dadbod-ui' -- UI For Dadbod
|
||||
use 'tpope/vim-speeddating' -- <C-A> and <C-X> for dates
|
||||
use 'tpope/vim-dispatch' -- Dispatch command
|
||||
use 'tpope/vim-projectionist' -- Project config file!
|
||||
use 'tpope/vim-unimpaired' -- Additional [ and ] mappings
|
||||
use 'tpope/vim-repeat' -- Better . repeat
|
||||
use 'tpope/vim-commentary' -- Commenting motion
|
||||
use 'tpope/vim-sleuth' -- Intendation heuristics
|
||||
-- Tpope general improvements
|
||||
use "tpope/vim-sensible" -- Sane defaults
|
||||
use "tpope/vim-endwise" -- Add closing statements automatically for if, function etc
|
||||
use "tpope/vim-surround" -- Surround with ', ", etc
|
||||
use "tpope/vim-fugitive" -- Git integration
|
||||
use "tpope/vim-vinegar" -- Netrw improvements
|
||||
use "tpope/vim-obsession" -- Session.vim management
|
||||
use "tpope/vim-dadbod" -- Database access
|
||||
use "kristijanhusak/vim-dadbod-ui" -- UI For Dadbod
|
||||
use "tpope/vim-speeddating" -- <C-A> and <C-X> for dates
|
||||
use "tpope/vim-dispatch" -- Dispatch command
|
||||
use "tpope/vim-projectionist" -- Project config file!
|
||||
use "tpope/vim-unimpaired" -- Additional [ and ] mappings
|
||||
use "tpope/vim-repeat" -- Better . repeat
|
||||
use "tpope/vim-commentary" -- Commenting motion
|
||||
use "tpope/vim-sleuth" -- Intendation heuristics
|
||||
|
||||
-- General improvements --
|
||||
use 'airblade/vim-gitgutter' -- Git signs
|
||||
use 'godlygeek/tabular' -- Tabular command for alignment
|
||||
use 'vim-scripts/utl.vim' -- Universal text linking
|
||||
use { --
|
||||
'mbbill/undotree', --
|
||||
cmd = 'UndotreeToggle' --
|
||||
-- General improvements
|
||||
use "airblade/vim-gitgutter" -- Git signs
|
||||
use "godlygeek/tabular" -- Tabular command for alignment
|
||||
use "vim-scripts/utl.vim" -- Universal text linking
|
||||
use {
|
||||
"mbbill/undotree",
|
||||
cmd = "UndotreeToggle"
|
||||
} -- Undos in a tree for easy access
|
||||
use 'mhinz/vim-grepper' -- Grepper command - improved grepping throughout project
|
||||
use 'radenling/vim-dispatch-neovim' -- vim-dispatch for neovim - uses terminal
|
||||
use 'wellle/targets.vim' -- Additional targets for inside and around motions
|
||||
use 'flazz/vim-colorschemes' -- All popular colorschemes
|
||||
use 'romainl/vim-qf' -- Quickfix list upgrades
|
||||
use 'romainl/vim-devdocs' -- Quick DevDocs.io search using :DD
|
||||
use 'gpanders/editorconfig.nvim' -- .editorconfig support
|
||||
use 'lewis6991/impatient.nvim' -- Caching lua modules for faster startup
|
||||
use "mhinz/vim-grepper" -- Grepper command - improved grepping throughout project
|
||||
use "radenling/vim-dispatch-neovim" -- vim-dispatch for neovim - uses terminal
|
||||
use "wellle/targets.vim" -- Additional targets for inside and around motions
|
||||
use "flazz/vim-colorschemes" -- All popular colorschemes
|
||||
use "romainl/vim-qf" -- Quickfix list upgrades
|
||||
use "romainl/vim-devdocs" -- Quick DevDocs.io search using :DD
|
||||
use "gpanders/editorconfig.nvim" -- .editorconfig support
|
||||
use "lewis6991/impatient.nvim" -- Caching lua modules for faster startup
|
||||
|
||||
-- Tools --
|
||||
use 'direnv/direnv.vim' -- Integration with Direnv
|
||||
use 'vim-test/vim-test' -- Running tests from vim
|
||||
use 'dense-analysis/ale' -- Asynchronous Lint Engine - used for linting, not for LSP
|
||||
use 'nathunsmitty/nvim-ale-diagnostic' -- Neovim LSP + ALE integration
|
||||
use 'mfussenegger/nvim-dap' -- Debug Adapter Protocol
|
||||
use 'rcarriga/nvim-dap-ui' -- UI components for DAP
|
||||
use 'theHamsta/nvim-dap-virtual-text' -- Virtual text display for DAP
|
||||
use 'diepm/vim-rest-console' -- REST console for vim
|
||||
use 'Pocco81/DAPInstall.nvim' -- Easy DAP configuration
|
||||
use 'jamestthompson3/nvim-remote-containers' -- devcontainer.json support
|
||||
use 'jbyuki/one-small-step-for-vimkind' -- Debugger for Nvim-Lua
|
||||
-- Tools
|
||||
use "direnv/direnv.vim" -- Integration with Direnv
|
||||
use "vim-test/vim-test" -- Running tests from vim
|
||||
use "dense-analysis/ale" -- Asynchronous Lint Engine - used for linting, not for LSP
|
||||
use "nathunsmitty/nvim-ale-diagnostic" -- Neovim LSP + ALE integration
|
||||
use "mfussenegger/nvim-dap" -- Debug Adapter Protocol
|
||||
use "rcarriga/nvim-dap-ui" -- UI components for DAP
|
||||
use "theHamsta/nvim-dap-virtual-text" -- Virtual text display for DAP
|
||||
use "diepm/vim-rest-console" -- REST console for vim
|
||||
use "Pocco81/DAPInstall.nvim" -- Easy DAP configuration
|
||||
use "jamestthompson3/nvim-remote-containers" -- devcontainer.json support
|
||||
use "jbyuki/one-small-step-for-vimkind" -- Debugger for Nvim-Lua
|
||||
|
||||
-- Snippets --
|
||||
if vim.g.loaded_python3_provider ~= 0 --
|
||||
then --
|
||||
use 'SirVer/ultisnips' -- Snippets in python format
|
||||
use 'honza/vim-snippets' -- Collection of snippets for UltiSnips
|
||||
end --
|
||||
-- Snippets
|
||||
if vim.g.loaded_python3_provider ~= 0 then
|
||||
use "SirVer/ultisnips" -- Snippets in python format
|
||||
use "honza/vim-snippets" -- Collection of snippets for UltiSnips
|
||||
end
|
||||
|
||||
-- Language support --
|
||||
use 'tpope/vim-rails' -- Enables all rails command through vim and integrates with projectionist
|
||||
use 'c-brenn/phoenix.vim' -- Similar to vim-rails, but for phoenix
|
||||
use 'tpope/vim-salve' -- Clojure integration with projectionist
|
||||
use 'tpope/vim-fireplace' -- Clojure REPL and integration
|
||||
use 'vimwiki/vimwiki' -- Vimwiki - personal wiki in vim
|
||||
use 'esensar/vimwiki-reviews-lua' -- Vimwiki extension for periodic reviews
|
||||
use 'ledger/vim-ledger' -- Support for ledger-cli format
|
||||
use 'tandrewnichols/vim-docile' -- Support for vim doc.txt format
|
||||
use 'habamax/vim-godot' -- Godot engine (and script) support
|
||||
use 'guns/vim-sexp' -- Precision editing for S-expressions
|
||||
use( -- Simpler keymaps for vim-sexp
|
||||
'tpope/vim-sexp-mappings-for-regular-people'
|
||||
)
|
||||
use 'tridactyl/vim-tridactyl' -- Tridactyl config file support
|
||||
-- Language support
|
||||
use "tpope/vim-rails" -- Enables all rails command through vim and integrates with projectionist
|
||||
use "c-brenn/phoenix.vim" -- Similar to vim-rails, but for phoenix
|
||||
use "tpope/vim-salve" -- Clojure integration with projectionist
|
||||
use "tpope/vim-fireplace" -- Clojure REPL and integration
|
||||
use "vimwiki/vimwiki" -- Vimwiki - personal wiki in vim
|
||||
use "esensar/vimwiki-reviews-lua" -- Vimwiki extension for periodic reviews
|
||||
use "ledger/vim-ledger" -- Support for ledger-cli format
|
||||
use "tandrewnichols/vim-docile" -- Support for vim doc.txt format
|
||||
use "habamax/vim-godot" -- Godot engine (and script) support
|
||||
use "guns/vim-sexp" -- Precision editing for S-expressions
|
||||
use("tpope/vim-sexp-mappings-for-regular-people") -- Simpler keymaps for vim-sexp
|
||||
use "tridactyl/vim-tridactyl" -- Tridactyl config file support
|
||||
use "aklt/plantuml-syntax" -- PlantUML support
|
||||
|
||||
-- Treesitter --
|
||||
use { --
|
||||
'nvim-treesitter/nvim-treesitter', --
|
||||
run = ':TSUpdate' --
|
||||
-- Treesitter
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate"
|
||||
} -- Treesitter integration
|
||||
use 'nvim-treesitter/playground' -- TSPlaygroundToggle - access treesitter data
|
||||
use "nvim-treesitter/playground" -- TSPlaygroundToggle - access treesitter data
|
||||
|
||||
-- LSP --
|
||||
use 'neovim/nvim-lspconfig' -- Easy LSP Config
|
||||
use 'alexaandru/nvim-lspupdate' -- Easy install and update for many LSP servers
|
||||
use 'hrsh7th/cmp-nvim-lsp' -- LSP source for cmp
|
||||
use 'hrsh7th/cmp-buffer' -- Buffer source for nvim-cmp
|
||||
use 'hrsh7th/cmp-path' -- Path source for nvim-cmp
|
||||
use 'hrsh7th/cmp-nvim-lua' -- Nvim-Lua source for nvim-cmp
|
||||
use 'quangnguyen30192/cmp-nvim-ultisnips' -- Ultisnips source for nvim-cmp
|
||||
use 'hrsh7th/nvim-cmp' -- completion integration
|
||||
use 'nvim-lua/lsp_extensions.nvim' -- LSP extensions (like closing labels for Dart)
|
||||
-- LSP
|
||||
use "neovim/nvim-lspconfig" -- Easy LSP Config
|
||||
use "alexaandru/nvim-lspupdate" -- Easy install and update for many LSP servers
|
||||
use "hrsh7th/cmp-nvim-lsp" -- LSP source for cmp
|
||||
use "hrsh7th/cmp-buffer" -- Buffer source for nvim-cmp
|
||||
use "hrsh7th/cmp-path" -- Path source for nvim-cmp
|
||||
use "hrsh7th/cmp-nvim-lua" -- Nvim-Lua source for nvim-cmp
|
||||
use "quangnguyen30192/cmp-nvim-ultisnips" -- Ultisnips source for nvim-cmp
|
||||
use "hrsh7th/nvim-cmp" -- completion integration
|
||||
use "nvim-lua/lsp_extensions.nvim" -- LSP extensions (like closing labels for Dart)
|
||||
|
||||
-- LSP language specific
|
||||
use 'tjdevries/nlua.nvim' -- Built-in Lua integration with LSP
|
||||
use 'akinsho/flutter-tools.nvim' -- Additional flutter integrations
|
||||
use 'mfussenegger/nvim-jdtls' -- Additional java integrations
|
||||
use "tjdevries/nlua.nvim" -- Built-in Lua integration with LSP
|
||||
use "akinsho/flutter-tools.nvim" -- Additional flutter integrations
|
||||
use "mfussenegger/nvim-jdtls" -- Additional java integrations
|
||||
|
||||
-- Lua support --
|
||||
use 'tjdevries/astronauta.nvim' -- Support for lua ftplugins and plugins
|
||||
use 'nvim-lua/popup.nvim' -- Popup API integration - needed for some plugins
|
||||
use 'nvim-lua/plenary.nvim' -- Lua helpers
|
||||
-- Lua support
|
||||
use "tjdevries/astronauta.nvim" -- Support for lua ftplugins and plugins
|
||||
use "nvim-lua/popup.nvim" -- Popup API integration - needed for some plugins
|
||||
use "nvim-lua/plenary.nvim" -- Lua helpers
|
||||
|
||||
-- Telescope --
|
||||
use 'nvim-telescope/telescope.nvim' -- Fuzzy searcher
|
||||
use 'nvim-telescope/telescope-dap.nvim' -- DAP integration for Telescope
|
||||
-- Telescope
|
||||
use "nvim-telescope/telescope.nvim" -- Fuzzy searcher
|
||||
use "nvim-telescope/telescope-dap.nvim" -- DAP integration for Telescope
|
||||
end
|
||||
}
|
||||
|
|
|
@ -5,25 +5,25 @@
|
|||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = "menu,menuone,noselect"
|
||||
|
||||
local cmp = require'cmp'
|
||||
local cmp = require "cmp"
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["UltiSnips#Anon"](args.body)
|
||||
end,
|
||||
end
|
||||
},
|
||||
mapping = {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
["<C-y>"] = cmp.mapping.confirm({select = true})
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'path' },
|
||||
{ name = 'ultisnips' },
|
||||
{ name = 'buffer' },
|
||||
{name = "nvim_lsp"},
|
||||
{name = "nvim_lua"},
|
||||
{name = "path"},
|
||||
{name = "ultisnips"},
|
||||
{name = "buffer"}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,12 +4,14 @@
|
|||
|
||||
require("nvim-ale-diagnostic")
|
||||
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] =
|
||||
vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics,
|
||||
{
|
||||
underline = false,
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
update_in_insert = false,
|
||||
update_in_insert = false
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -6,59 +6,62 @@ local common_config = require("lsp.server_config")
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
require'jdtls'.setup_dap()
|
||||
require'jdtls.setup'.add_commands()
|
||||
require "jdtls".setup_dap()
|
||||
require "jdtls.setup".add_commands()
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
local function buf_set_option(...)
|
||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
end
|
||||
|
||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
local default_opts = {noremap = true, silent = true}
|
||||
|
||||
common_config.on_attach(client, bufnr)
|
||||
|
||||
buf_set_keymap('n', '<A-CR>', "<cmd>lua require('jdtls').code_action()<CR>", default_opts)
|
||||
buf_set_keymap('n', '<Leader>ac', "<cmd>lua require('jdtls').code_action()<CR>", default_opts)
|
||||
buf_set_keymap("n", "<A-CR>", "<cmd>lua require('jdtls').code_action()<CR>", default_opts)
|
||||
buf_set_keymap("n", "<Leader>ac", "<cmd>lua require('jdtls').code_action()<CR>", default_opts)
|
||||
end
|
||||
|
||||
local root_markers = {'gradlew', 'pom.xml'}
|
||||
local root_dir = require('jdtls.setup').find_root(root_markers)
|
||||
local home = os.getenv('HOME')
|
||||
local root_markers = {"gradlew", "pom.xml"}
|
||||
local root_dir = require("jdtls.setup").find_root(root_markers)
|
||||
local home = os.getenv("HOME")
|
||||
|
||||
local workspace_folder = home .. "/.workspace" .. vim.fn.fnamemodify(root_dir, ":p:h:t")
|
||||
local config = {
|
||||
flags = {
|
||||
allow_incremental_sync = true,
|
||||
};
|
||||
on_attach = on_attach,
|
||||
allow_incremental_sync = true
|
||||
},
|
||||
on_attach = on_attach
|
||||
}
|
||||
config.settings = {
|
||||
java = {
|
||||
signatureHelp = { enabled = true };
|
||||
signatureHelp = {enabled = true},
|
||||
sources = {
|
||||
organizeImports = {
|
||||
starThreshold = 9999;
|
||||
staticStarThreshold = 9999;
|
||||
};
|
||||
};
|
||||
};
|
||||
starThreshold = 9999,
|
||||
staticStarThreshold = 9999
|
||||
}
|
||||
config.cmd = {'jdtls-start.sh', workspace_folder}
|
||||
}
|
||||
}
|
||||
}
|
||||
config.cmd = {"jdtls-start.sh", workspace_folder}
|
||||
config.on_init = function(client, _)
|
||||
client.notify('workspace/didChangeConfiguration', { settings = config.settings })
|
||||
client.notify("workspace/didChangeConfiguration", {settings = config.settings})
|
||||
end
|
||||
|
||||
local extendedClientCapabilities = require'jdtls'.extendedClientCapabilities
|
||||
local extendedClientCapabilities = require "jdtls".extendedClientCapabilities
|
||||
extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
|
||||
config.init_options = {
|
||||
-- bundles = bundles;
|
||||
extendedClientCapabilities = extendedClientCapabilities;
|
||||
extendedClientCapabilities = extendedClientCapabilities
|
||||
}
|
||||
|
||||
-- Server
|
||||
require('jdtls').start_or_attach(config)
|
||||
require("jdtls").start_or_attach(config)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -5,24 +5,28 @@
|
|||
local M = {}
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
local function buf_set_option(...)
|
||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
end
|
||||
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
local default_opts = {noremap = true, silent = true}
|
||||
|
||||
-- Lsp keymaps
|
||||
buf_set_keymap('n', '<C-]>', '<cmd>lua vim.lsp.buf.definition()<CR>', default_opts)
|
||||
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', default_opts)
|
||||
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', default_opts)
|
||||
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', default_opts)
|
||||
buf_set_keymap('n', '<Leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', default_opts)
|
||||
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', default_opts)
|
||||
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', default_opts)
|
||||
buf_set_keymap('n', '<A-CR>', '<cmd>lua vim.lsp.buf.code_action()<CR>', default_opts)
|
||||
buf_set_keymap('n', '<Leader>ac', '<cmd>lua vim.lsp.buf.code_action()<CR>', default_opts)
|
||||
buf_set_keymap('n', '<Leader>a', '<cmd>lua vim.lsp.buf.code_action_range()<CR>', default_opts)
|
||||
buf_set_keymap("n", "<C-]>", "<cmd>lua vim.lsp.buf.definition()<CR>", default_opts)
|
||||
buf_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", default_opts)
|
||||
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", default_opts)
|
||||
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", default_opts)
|
||||
buf_set_keymap("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", default_opts)
|
||||
buf_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", default_opts)
|
||||
buf_set_keymap("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", default_opts)
|
||||
buf_set_keymap("n", "<A-CR>", "<cmd>lua vim.lsp.buf.code_action()<CR>", default_opts)
|
||||
buf_set_keymap("n", "<Leader>ac", "<cmd>lua vim.lsp.buf.code_action()<CR>", default_opts)
|
||||
buf_set_keymap("n", "<Leader>a", "<cmd>lua vim.lsp.buf.code_action_range()<CR>", default_opts)
|
||||
end
|
||||
|
||||
return M;
|
||||
return M
|
||||
|
|
|
@ -5,10 +5,28 @@
|
|||
local lspconfig = require("lspconfig")
|
||||
local common_config = require("lsp.server_config")
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
-- Lsp default language servers
|
||||
local servers = { "bashls", "clangd", "cucumber_language_server", "crystalline", "dockerls", "jsonls", "hls", "pyright", "rust_analyzer", "kotlin_language_server", "mint", "vimls", "clojure_lsp", "gopls", "gdscript", "solang", "terraformls", "tsserver" }
|
||||
local servers = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"cucumber_language_server",
|
||||
"crystalline",
|
||||
"dockerls",
|
||||
"jsonls",
|
||||
"hls",
|
||||
"pyright",
|
||||
"rust_analyzer",
|
||||
"kotlin_language_server",
|
||||
"mint",
|
||||
"vimls",
|
||||
"clojure_lsp",
|
||||
"gopls",
|
||||
"solang",
|
||||
"terraformls",
|
||||
"tsserver"
|
||||
}
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = common_config.on_attach,
|
||||
|
@ -16,17 +34,28 @@ for _, lsp in ipairs(servers) do
|
|||
}
|
||||
end
|
||||
|
||||
-- Lua bultin lsp
|
||||
require('nlua.lsp.nvim').setup(lspconfig, {
|
||||
lspconfig["gdscript"].setup {
|
||||
on_attach = common_config.on_attach,
|
||||
capabilities = capabilities,
|
||||
flags = {
|
||||
-- Slow Godot LS
|
||||
debounce_text_changes = 600
|
||||
}
|
||||
}
|
||||
|
||||
-- Lua bultin lsp
|
||||
require("nlua.lsp.nvim").setup(
|
||||
lspconfig,
|
||||
{
|
||||
on_attach = common_config.on_attach,
|
||||
capabilities = capabilities,
|
||||
-- Include globals you want to tell the LSP are real :)
|
||||
globals = {}
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
-- Flutter tools
|
||||
require('flutter-tools').setup {
|
||||
require("flutter-tools").setup {
|
||||
lsp = {
|
||||
on_attach = common_config.on_attach,
|
||||
capabilities = capabilities
|
||||
|
@ -35,16 +64,16 @@ require('flutter-tools').setup {
|
|||
|
||||
-- Dotnet LS
|
||||
local pid = vim.fn.getpid()
|
||||
local omnisharp_bin = vim.fn.glob('$HOME') .. "/lsp/dotnet/omnisharp/run"
|
||||
local omnisharp_bin = vim.fn.glob("$HOME") .. "/lsp/dotnet/omnisharp/run"
|
||||
lspconfig.omnisharp.setup {
|
||||
cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) };
|
||||
on_attach = common_config.on_attach;
|
||||
cmd = {omnisharp_bin, "--languageserver", "--hostPID", tostring(pid)},
|
||||
on_attach = common_config.on_attach,
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- Leminx (XML Language server)
|
||||
lspconfig.lemminx.setup {
|
||||
cmd = { "lemminx" };
|
||||
on_attach = common_config.on_attach;
|
||||
cmd = {"lemminx"},
|
||||
on_attach = common_config.on_attach,
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
|
|
@ -3,30 +3,30 @@
|
|||
-------------------------------------------------------------------------------
|
||||
|
||||
local function get_vim_rest_home_dir()
|
||||
vim.fn.mkdir(vim.env.NVIMHOME .. '/vim-rest-console', 'p')
|
||||
return vim.env.NVIMHOME .. '/vim-rest-console'
|
||||
vim.fn.mkdir(vim.env.NVIMHOME .. "/vim-rest-console", "p")
|
||||
return vim.env.NVIMHOME .. "/vim-rest-console"
|
||||
end
|
||||
|
||||
-- Opens up a new tab if current buffer is not empty
|
||||
local function new_tab_if_needed()
|
||||
if vim.api.nvim_buf_get_name('%') ~= '' then
|
||||
if vim.api.nvim_buf_get_name("%") ~= "" then
|
||||
-- Current buffer is not empty, open up a new tab
|
||||
vim.cmd('tabnew')
|
||||
vim.cmd("tabnew")
|
||||
end
|
||||
end
|
||||
|
||||
local function open_rest_console(file)
|
||||
new_tab_if_needed()
|
||||
local ending = '.rest'
|
||||
if file:sub(-#ending) ~= ending then
|
||||
file = file .. '.rest'
|
||||
local ending = ".rest"
|
||||
if file:sub(-(#ending)) ~= ending then
|
||||
file = file .. ".rest"
|
||||
end
|
||||
vim.cmd('e ' .. file)
|
||||
vim.cmd("e " .. file)
|
||||
end
|
||||
|
||||
local function open_cached_rest_console(name)
|
||||
local dir = get_vim_rest_home_dir()
|
||||
open_rest_console(dir .. '/' .. name)
|
||||
open_rest_console(dir .. "/" .. name)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
@ -38,29 +38,29 @@ local M = {}
|
|||
-- Opens us a scratch rest console (not saved)
|
||||
function M.open_scratch_rest_console()
|
||||
new_tab_if_needed()
|
||||
vim.cmd('set ft=rest')
|
||||
vim.cmd("set ft=rest")
|
||||
end
|
||||
|
||||
-- Opens up a rest console which can be saved -- cached by name
|
||||
function M.open_cached_rest_console(...)
|
||||
local name = select(1, ...)
|
||||
if (select('#', ...) == 0) then
|
||||
name = require'common.projects'.get_project_id()
|
||||
if (select("#", ...) == 0) then
|
||||
name = require "common.projects".get_project_id()
|
||||
end
|
||||
open_cached_rest_console(name)
|
||||
end
|
||||
|
||||
-- Opens up a rest console which can be saved -- cached by name
|
||||
function M.open_named_cached_rest_console(name)
|
||||
name = require'common.projects'.get_project_id() .. name
|
||||
name = require "common.projects".get_project_id() .. name
|
||||
open_cached_rest_console(name)
|
||||
end
|
||||
|
||||
-- Opens up a rest console based on local file path
|
||||
function M.open_local_rest_console(...)
|
||||
local file = select(1, ...)
|
||||
if (select('#', ...) == 0) then
|
||||
file = 'default'
|
||||
if (select("#", ...) == 0) then
|
||||
file = "default"
|
||||
end
|
||||
open_rest_console(file)
|
||||
end
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
-- - Vimwiki extensions library -
|
||||
-- Relies on vimwiki-reviews-lua for its vimwiki API
|
||||
-------------------------------------------------------------------------------
|
||||
local api = require('vimwiki_reviews.vimwiki_api')
|
||||
local utils = require('vimwiki_reviews.utils')
|
||||
local templates = require('vimwiki_reviews.templates')
|
||||
local Path = require('plenary.path')
|
||||
local scandir = require('plenary.scandir')
|
||||
local api = require("vimwiki_reviews.vimwiki_api")
|
||||
local utils = require("vimwiki_reviews.utils")
|
||||
local templates = require("vimwiki_reviews.templates")
|
||||
local Path = require("plenary.path")
|
||||
local scandir = require("plenary.scandir")
|
||||
|
||||
local M = {}
|
||||
|
||||
|
@ -15,28 +15,30 @@ function M.get_vimwiki_subdir(vimwiki_index, directory)
|
|||
vimwiki_index = api.normalize_vimwiki_index(vimwiki_index)
|
||||
local vimwiki = vim.g.vimwiki_list[vimwiki_index]
|
||||
|
||||
return vimwiki.path .. directory .. '/'
|
||||
return vimwiki.path .. directory .. "/"
|
||||
end
|
||||
|
||||
function M.get_directory_index(vimwiki_index, directory)
|
||||
local dir = M.get_vimwiki_subdir(vimwiki_index, directory)
|
||||
local path = Path:new(dir):expand()
|
||||
|
||||
local entries = scandir.scan_dir(
|
||||
local entries =
|
||||
scandir.scan_dir(
|
||||
path,
|
||||
{
|
||||
hidden = false,
|
||||
add_dirs = false,
|
||||
respect_gitignore = true,
|
||||
depth = 1
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
local index = {}
|
||||
|
||||
for _,entry in pairs(entries) do
|
||||
for _, entry in pairs(entries) do
|
||||
local filename = utils.get_filename_from_path(entry)
|
||||
local ext = api.get_vimwiki_extension(vimwiki_index)
|
||||
local noext = string.gsub(filename, ext, '')
|
||||
local noext = string.gsub(filename, ext, "")
|
||||
|
||||
index[noext] = filename
|
||||
end
|
||||
|
@ -49,24 +51,23 @@ end
|
|||
function M.open_subdirectory_index_file(vimwiki_index, subdirectory)
|
||||
local dir = M.get_vimwiki_subdir(vimwiki_index, subdirectory)
|
||||
local ext = api.get_vimwiki_extension(vimwiki_index)
|
||||
local filename = dir .. 'index' .. ext
|
||||
vim.cmd('edit ' .. filename)
|
||||
local filename = dir .. "index" .. ext
|
||||
vim.cmd("edit " .. filename)
|
||||
|
||||
local index = M.get_directory_index(vimwiki_index, subdirectory)
|
||||
|
||||
local builder = templates.for_vimwiki(vimwiki_index)
|
||||
|
||||
local lines = {
|
||||
builder.header(1, subdirectory:sub(1,1):upper()..subdirectory:sub(2)),
|
||||
'',
|
||||
builder.header(1, subdirectory:sub(1, 1):upper() .. subdirectory:sub(2)),
|
||||
""
|
||||
}
|
||||
|
||||
-- Add items
|
||||
for title, fname in pairs(index) do
|
||||
if (title ~= 'index')
|
||||
then
|
||||
title = string.gsub(title, '-', ' ')
|
||||
title = title:sub(1,1):upper()..title:sub(2)
|
||||
if (title ~= "index") then
|
||||
title = string.gsub(title, "-", " ")
|
||||
title = title:sub(1, 1):upper() .. title:sub(2)
|
||||
table.insert(lines, builder.list_item(builder.link(fname, title)))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
-- - NeoVim DAP (Debug Adapter Protocol) config -
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
local dap = require('dap')
|
||||
local dap_install = require('dap-install')
|
||||
local dap = require("dap")
|
||||
local dap_install = require("dap-install")
|
||||
|
||||
local dbg_list = require("dap-install.api.debuggers").get_installed_debuggers()
|
||||
|
||||
|
@ -17,14 +17,16 @@ vim.cmd [[ au FileType dap-repl lua require('dap.ext.autocompl').attach() ]]
|
|||
require("nvim-dap-virtual-text").setup()
|
||||
|
||||
-- Keymaps
|
||||
local function set_keymap(...) vim.api.nvim_set_keymap(...) end
|
||||
local function set_keymap(...)
|
||||
vim.api.nvim_set_keymap(...)
|
||||
end
|
||||
|
||||
local default_opts = {noremap = true, silent = true}
|
||||
set_keymap('n', '<Leader>db', "<cmd>lua require'dap'.toggle_breakpoint()<CR>", default_opts)
|
||||
set_keymap('n', '<Leader>dc', "<cmd>lua require'dap'.continue()<CR>", default_opts)
|
||||
set_keymap('n', '<Leader>dso', "<cmd>lua require'dap'.step_over()<CR>", default_opts)
|
||||
set_keymap('n', '<Leader>dsi', "<cmd>lua require'dap'.step_into()<CR>", default_opts)
|
||||
set_keymap('n', '<Leader>dro', "<cmd>lua require'dap'.open()<CR>", default_opts)
|
||||
set_keymap("n", "<Leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", default_opts)
|
||||
set_keymap("n", "<Leader>dc", "<cmd>lua require'dap'.continue()<CR>", default_opts)
|
||||
set_keymap("n", "<Leader>dso", "<cmd>lua require'dap'.step_over()<CR>", default_opts)
|
||||
set_keymap("n", "<Leader>dsi", "<cmd>lua require'dap'.step_into()<CR>", default_opts)
|
||||
set_keymap("n", "<Leader>dro", "<cmd>lua require'dap'.open()<CR>", default_opts)
|
||||
|
||||
-- Nvim DAP UI
|
||||
require("dapui").setup()
|
||||
|
@ -32,29 +34,22 @@ require("dapui").setup()
|
|||
-- Debugger Hover map
|
||||
local api = vim.api
|
||||
local keymap_restore = {}
|
||||
dap.listeners.after['event_initialized']['me'] = function()
|
||||
dap.listeners.after["event_initialized"]["me"] = function()
|
||||
for _, buf in pairs(api.nvim_list_bufs()) do
|
||||
local keymaps = api.nvim_buf_get_keymap(buf, 'n')
|
||||
local keymaps = api.nvim_buf_get_keymap(buf, "n")
|
||||
for _, keymap in pairs(keymaps) do
|
||||
if keymap.lhs == "K" then
|
||||
table.insert(keymap_restore, keymap)
|
||||
api.nvim_buf_del_keymap(buf, 'n', 'K')
|
||||
api.nvim_buf_del_keymap(buf, "n", "K")
|
||||
end
|
||||
end
|
||||
end
|
||||
api.nvim_set_keymap(
|
||||
'n', 'K', '<Cmd>lua require("dap.ui.variables").hover()<CR>', { silent = true })
|
||||
api.nvim_set_keymap("n", "K", '<Cmd>lua require("dap.ui.variables").hover()<CR>', {silent = true})
|
||||
end
|
||||
|
||||
dap.listeners.after['event_terminated']['me'] = function()
|
||||
dap.listeners.after["event_terminated"]["me"] = function()
|
||||
for _, keymap in pairs(keymap_restore) do
|
||||
api.nvim_buf_set_keymap(
|
||||
keymap.buffer,
|
||||
keymap.mode,
|
||||
keymap.lhs,
|
||||
keymap.rhs,
|
||||
{ silent = keymap.silent == 1 }
|
||||
)
|
||||
api.nvim_buf_set_keymap(keymap.buffer, keymap.mode, keymap.lhs, keymap.rhs, {silent = keymap.silent == 1})
|
||||
end
|
||||
keymap_restore = {}
|
||||
end
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
-- - Fugitive.vim setup and extra commands -
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
vim.cmd[[command! -nargs=0 Ggpush :lua require('fugitive_extensions').push_origin()]]
|
||||
vim.cmd[[command! -nargs=0 Ggpull :lua require('fugitive_extensions').pull_origin()]]
|
||||
vim.cmd[[command! -nargs=? Gpropen :lua require('fugitive_extensions').open_new_pr(<f-args>)]]
|
||||
vim.cmd[[command! -nargs=? Gpr Gpropen <args>]]
|
||||
vim.cmd[[command! -nargs=? Gprprint :lua require('fugitive_extensions').print_pr_url(<f-args>)]]
|
||||
vim.cmd[[command! -nargs=? Gprcopy :lua require('fugitive_extensions').copy_pr_url(<f-args>)]]
|
||||
vim.cmd[[command! -nargs=1 Gcbranch :lua require('fugitive_extensions').create_branch(<f-args>)]]
|
||||
vim.cmd[[command! -nargs=0 Gcmaster :lua require('fugitive_extensions').checkout_branch('main')]]
|
||||
vim.cmd[[command! -nargs=0 Gcm Gcmaster]]
|
||||
vim.cmd[[command! -nargs=0 Gcdev :lua require('fugitive_extensions').checkout_branch('develop')]]
|
||||
vim.cmd[[command! -nargs=1 Gcheckout :lua require('fugitive_extensions').checkout_branch(<f-args>)]]
|
||||
vim.cmd[[command! -nargs=1 Gc Gcheckout <args>]]
|
||||
vim.cmd [[command! -nargs=0 Ggpush :lua require('fugitive_extensions').push_origin()]]
|
||||
vim.cmd [[command! -nargs=0 Ggpull :lua require('fugitive_extensions').pull_origin()]]
|
||||
vim.cmd [[command! -nargs=? Gpropen :lua require('fugitive_extensions').open_new_pr(<f-args>)]]
|
||||
vim.cmd [[command! -nargs=? Gpr Gpropen <args>]]
|
||||
vim.cmd [[command! -nargs=? Gprprint :lua require('fugitive_extensions').print_pr_url(<f-args>)]]
|
||||
vim.cmd [[command! -nargs=? Gprcopy :lua require('fugitive_extensions').copy_pr_url(<f-args>)]]
|
||||
vim.cmd [[command! -nargs=1 Gcbranch :lua require('fugitive_extensions').create_branch(<f-args>)]]
|
||||
vim.cmd [[command! -nargs=0 Gcmaster :lua require('fugitive_extensions').checkout_branch('main')]]
|
||||
vim.cmd [[command! -nargs=0 Gcm Gcmaster]]
|
||||
vim.cmd [[command! -nargs=0 Gcdev :lua require('fugitive_extensions').checkout_branch('develop')]]
|
||||
vim.cmd [[command! -nargs=1 Gcheckout :lua require('fugitive_extensions').checkout_branch(<f-args>)]]
|
||||
vim.cmd [[command! -nargs=1 Gc Gcheckout <args>]]
|
||||
|
|
|
@ -140,7 +140,7 @@ local python_config = {
|
|||
" pass",
|
||||
"",
|
||||
"",
|
||||
"if __name__ == \"__main__\":",
|
||||
'if __name__ == "__main__":',
|
||||
" unittest.main()"
|
||||
}
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ local vim_plugin_config = {
|
|||
["plugin/*.vim"] = {
|
||||
type = "plugin",
|
||||
template = {
|
||||
"if exists(\"g:loaded_{}\") || &cp | finish | endif",
|
||||
'if exists("g:loaded_{}") || &cp | finish | endif',
|
||||
"",
|
||||
"let g:loaded_{} = 1"
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ local lua_vim_plugin_config = {
|
|||
["plugin/*.vim"] = {
|
||||
type = "plugin",
|
||||
template = {
|
||||
"if exists(\"g:loaded_{}\") || &cp | finish | endif",
|
||||
'if exists("g:loaded_{}") || &cp | finish | endif',
|
||||
"",
|
||||
"let g:loaded_{} = 1"
|
||||
}
|
||||
|
@ -311,17 +311,17 @@ local java_project_config = {
|
|||
alternate = "src/main/java/{}.java"
|
||||
},
|
||||
["src/main/java/module-info.java"] = {
|
||||
type = "moduleinfo",
|
||||
type = "moduleinfo"
|
||||
},
|
||||
["src/main/java/**/package-info.java"] = {
|
||||
type = "packageinfo",
|
||||
type = "packageinfo"
|
||||
},
|
||||
["src/main/resources/*"] = {
|
||||
type = "resource"
|
||||
},
|
||||
["src/test/resources/*"] = {
|
||||
type = "testresource"
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
local kotlin_project_config = {
|
||||
|
@ -393,8 +393,8 @@ local mint_config = {
|
|||
["tests/*.mint"] = {
|
||||
type = "test",
|
||||
template = {
|
||||
"suite \"{basename}\" {open}",
|
||||
" test \"A test\" {open}",
|
||||
'suite "{basename}" {open}',
|
||||
' test "A test" {open}',
|
||||
" with Test.Html {open}",
|
||||
" {close}",
|
||||
" {close}",
|
||||
|
@ -422,7 +422,7 @@ local crystal_config = {
|
|||
"describe {capitalize|colons} do",
|
||||
" # TODO Write tests",
|
||||
"",
|
||||
" it \"works\" do",
|
||||
' it "works" do',
|
||||
" false.should eq(true)",
|
||||
" end",
|
||||
"end"
|
||||
|
@ -441,7 +441,7 @@ local function c_project_config(source_extension, header_extension)
|
|||
alternate = {
|
||||
"src/{}." .. header_extension,
|
||||
"test/{}." .. source_extension,
|
||||
"include/{project|basename}/{}." .. header_extension,
|
||||
"include/{project|basename}/{}." .. header_extension
|
||||
}
|
||||
},
|
||||
["test/*." .. source_extension] = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- - Vim REST Console setup and extra commands -
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
vim.cmd[[command! -nargs=0 ScratchRestConsole :lua require('vim_rest_console_extensions').open_scratch_rest_console()]]
|
||||
vim.cmd[[command! -nargs=? RestConsole :lua require('vim_rest_console_extensions').open_cached_rest_console(<f-args>)]]
|
||||
vim.cmd[[command! -nargs=? RestConsoleLocal :lua require('vim_rest_console_extensions').open_local_rest_console(<f-args>)]]
|
||||
vim.cmd[[command! -nargs=1 RestConsoleCached :lua require('vim_rest_console_extensions').open_named_cached_rest_console(<f-args>)]]
|
||||
vim.cmd [[command! -nargs=0 ScratchRestConsole :lua require('vim_rest_console_extensions').open_scratch_rest_console()]]
|
||||
vim.cmd [[command! -nargs=? RestConsole :lua require('vim_rest_console_extensions').open_cached_rest_console(<f-args>)]]
|
||||
vim.cmd [[command! -nargs=? RestConsoleLocal :lua require('vim_rest_console_extensions').open_local_rest_console(<f-args>)]]
|
||||
vim.cmd [[command! -nargs=1 RestConsoleCached :lua require('vim_rest_console_extensions').open_named_cached_rest_console(<f-args>)]]
|
||||
|
|
|
@ -2,28 +2,30 @@
|
|||
-- - Telescope configuration -
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
local actions = require('telescope.actions')
|
||||
require('telescope').setup {
|
||||
local actions = require("telescope.actions")
|
||||
require("telescope").setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
-- Switch out M-q and C-q since C-q will be used more often
|
||||
["<M-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist
|
||||
},
|
||||
n = {
|
||||
-- Switch out M-q and C-q since C-q will be used more often
|
||||
["<M-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
require('telescope').load_extension('dap')
|
||||
require("telescope").load_extension("dap")
|
||||
|
||||
default_opts = {noremap = true}
|
||||
|
||||
local function set_keymap(...) vim.api.nvim_set_keymap(...) end
|
||||
set_keymap('n', '<C-P>', "<cmd>lua require('telescope.builtin').find_files()<CR>", default_opts)
|
||||
set_keymap('n', '<C-M-F>', "<cmd>lua require('telescope.builtin').live_grep()<CR>", default_opts)
|
||||
local function set_keymap(...)
|
||||
vim.api.nvim_set_keymap(...)
|
||||
end
|
||||
set_keymap("n", "<C-P>", "<cmd>lua require('telescope.builtin').find_files()<CR>", default_opts)
|
||||
set_keymap("n", "<C-M-F>", "<cmd>lua require('telescope.builtin').live_grep()<CR>", default_opts)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
require "nvim-treesitter.configs".setup {
|
||||
ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
enable = true -- false will disable the whole extension
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
|
|
Loading…
Reference in New Issue