removed lsp-zero and reconfigured lsp. setup cmp more throughly. added snippets. made packer file a bit more organized.
This commit is contained in:
parent
b69040fda0
commit
01b58f09b7
|
@ -77,6 +77,7 @@ alias get_channel_id="xargs curl -s | grep -Eo 'channel_id=.{0,50}' | sed 's/\".
|
|||
|
||||
alias vasm="~/stuff/manual-programs/vasm/vasm6502_oldstyle -Fbin -dotdir "
|
||||
alias pipes="pipes.sh -t 0 -p 3 -f 30 -r 2000"
|
||||
alias astro="astroterm --color --constellations --speed 10000 --fps 64 --unicode -i Arlington"
|
||||
alias anim="hyprctl keyword animations:enabled "
|
||||
|
||||
# mounting
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
# Which monitor should the notifications be displayed on.
|
||||
# i keep having to change this because hyprland ◔̯◔
|
||||
monitor = 0
|
||||
monitor = 1
|
||||
|
||||
# Display notification on focused monitor. Possible modes are:
|
||||
# mouse: follow mouse pointer
|
||||
|
|
|
@ -254,7 +254,7 @@ input {
|
|||
kb_layout = us
|
||||
kb_variant =
|
||||
kb_model =
|
||||
kb_options =
|
||||
kb_options = caps:swapescape
|
||||
kb_rules =
|
||||
|
||||
follow_mouse = 1
|
||||
|
|
|
@ -10,5 +10,8 @@
|
|||
"workspace.library": [
|
||||
"$VIMRUNTIME",
|
||||
"./lua"
|
||||
],
|
||||
"diagnostics.disable": [
|
||||
"deprecated"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,37 +1,5 @@
|
|||
local ok, _ = pcall(require, 'lsp-zero')
|
||||
if ok then
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "src",
|
||||
callback = function()
|
||||
print("LSP should now be active for src files")
|
||||
end,
|
||||
})
|
||||
|
||||
local lsp = require("lsp-zero")
|
||||
|
||||
lsp.preset("recommended")
|
||||
|
||||
|
||||
local cmp = require('cmp')
|
||||
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_mappings = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
mapping = cmp_mappings,
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
local on_atk = function(ev)
|
||||
local opts = {buffer = ev.buf, remap = false}
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
|
@ -43,8 +11,110 @@ if ok then
|
|||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end
|
||||
|
||||
local ok, trouble = pcall(require, 'trouble')
|
||||
if ok then
|
||||
trouble.setup({ icons = {} })
|
||||
vim.keymap.set("n", "<leader>tt", "<cmd>Trouble diagnostics toggle<cr>")
|
||||
|
||||
vim.keymap.set("n", "[t", function()
|
||||
trouble.next({skip_groups = true, jump = true})
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "]t", function()
|
||||
trouble.prev({skip_groups = true, jump = true})
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
local ok, cmp = pcall(require, 'cmp')
|
||||
if ok then
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
-- ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below
|
||||
-- Set configuration for specific filetype.
|
||||
--[[ cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
require("cmp_git").setup() ]]--
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
||||
local ok, lsp = pcall(require, 'lspconfig')
|
||||
if ok then
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "src",
|
||||
callback = function()
|
||||
print("LSP should now be active for src files")
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
vim.diagnostic.config({
|
||||
update_in_insert = true,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
}
|
||||
})
|
||||
|
||||
vim.diagnostic.config({ virtual_text = true })
|
||||
|
||||
local lsp_configurations = require('lspconfig.configs')
|
||||
|
||||
|
@ -59,31 +129,53 @@ if ok then
|
|||
}
|
||||
end
|
||||
|
||||
-- to learn how to use mason.nvim with lsp-zero
|
||||
-- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guides/integrate-with-mason-nvim.md
|
||||
|
||||
local capabilities = vim.tbl_deep_extend(
|
||||
"force",
|
||||
{},
|
||||
vim.lsp.protocol.make_client_capabilities(),
|
||||
require('cmp_nvim_lsp').default_capabilities()
|
||||
)
|
||||
|
||||
require('mason').setup({
|
||||
registries = {
|
||||
"github:mason-org/mason-registry",
|
||||
},
|
||||
})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = { },
|
||||
ensure_installed = {
|
||||
--"markdownlint-cli2",
|
||||
--"markdown-toc",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"html",
|
||||
"cssls",
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
"ts_ls",
|
||||
},
|
||||
handlers = {
|
||||
lsp.default_setup,
|
||||
},
|
||||
})
|
||||
require('lspconfig').greybel.setup({})
|
||||
|
||||
lsp.setup()
|
||||
function(server_name)
|
||||
lsp[server_name].setup{capabilities = capabilities}
|
||||
end,
|
||||
["lua_ls"] = function ()
|
||||
lsp.lua_ls.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua ={
|
||||
diagnostics = {
|
||||
globasl = { "vim" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
})
|
||||
lsp.greybel.setup({})
|
||||
|
||||
|
||||
|
||||
local ok, null_ls = pcall(require, 'null-ls')
|
||||
if ok then
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.diagnostics.markdownlint_cli2,
|
||||
},
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
||||
callback = on_atk
|
||||
})
|
||||
end
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
local ok, null_ls = pcall(require, 'null-ls')
|
||||
if ok then
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.diagnostics.markdownlint_cli2,
|
||||
},
|
||||
})
|
||||
end
|
|
@ -0,0 +1,18 @@
|
|||
local ok, luasnip= pcall(require, 'luasnip')
|
||||
if ok then
|
||||
luasnip.filetype_extend("javascript", { "jsdoc" })
|
||||
luasnip.filetype_extend("lua", { "luadoc" })
|
||||
luasnip.filetype_extend("rust", { "rustdoc" })
|
||||
luasnip.filetype_extend("c", { "cdoc" })
|
||||
|
||||
vim.keymap.set({"i"}, "<C-s>e", function() luasnip.expand() end, {silent = true})
|
||||
|
||||
vim.keymap.set({"i", "s"}, "<C-s>;", function() luasnip.jump(1) end, {silent = true})
|
||||
vim.keymap.set({"i", "s"}, "<C-s>,", function() luasnip.jump(-1) end, {silent = true})
|
||||
|
||||
vim.keymap.set({"i", "s"}, "<C-E>", function()
|
||||
if luasnip.choice_active() then
|
||||
luasnip.change_choice(1)
|
||||
end
|
||||
end, {silent = true})
|
||||
end
|
|
@ -4,15 +4,17 @@
|
|||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
-- Packer can manage itself
|
||||
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
use 'ThePrimeagen/vim-be-good'
|
||||
use 'ThePrimeagen/harpoon'
|
||||
-- # learning
|
||||
|
||||
use 'ThePrimeagen/vim-be-good'
|
||||
-- use 'vuciv/golf' --vim daily task
|
||||
use 'm4xshen/hardtime.nvim'
|
||||
|
||||
|
||||
-- # niceties
|
||||
|
||||
use 'rcarriga/nvim-notify'
|
||||
|
||||
use { "rose-pine/neovim", as = "rose-pine" }
|
||||
|
@ -22,20 +24,13 @@ return require('packer').startup(function(use)
|
|||
|
||||
use '3rd/image.nvim'
|
||||
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.8', -- 0.1.5
|
||||
-- or , branch = '0.1.x',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
use("mbbill/undotree")
|
||||
|
||||
use "lukas-reineke/indent-blankline.nvim"
|
||||
|
||||
use({ "NStefan002/screenkey.nvim", tag = "*" })
|
||||
|
||||
use("catgoose/nvim-colorizer.lua")
|
||||
|
||||
use("catgoose/nvim-colorizer.lua")
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
--requires = { 'nvim-tree/nvim-web-devicons', opt = true }
|
||||
|
@ -52,30 +47,53 @@ return require('packer').startup(function(use)
|
|||
})
|
||||
]]--
|
||||
|
||||
use 'tpope/vim-fugitive'
|
||||
|
||||
|
||||
-- # main dev requirements
|
||||
|
||||
use 'ThePrimeagen/harpoon'
|
||||
use("mbbill/undotree")
|
||||
|
||||
use {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v3.x',
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.8', -- 0.1.5
|
||||
-- or , branch = '0.1.x',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
requires = {
|
||||
--- Uncomment the two plugins below if you want to manage the language servers from neovim
|
||||
{'williamboman/mason.nvim'},
|
||||
{'williamboman/mason-lspconfig.nvim'},
|
||||
|
||||
-- LSP Support
|
||||
{'neovim/nvim-lspconfig'},
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
-- Autocompletion
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{'hrsh7th/cmp-buffer'},
|
||||
{'hrsh7th/cmp-path'},
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
{'hrsh7th/cmp-nvim-lua'},
|
||||
{'L3MON4D3/LuaSnip'},
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
'hrsh7th/nvim-cmp',
|
||||
--snippets
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'rafamadriz/friendly-snippets',
|
||||
}
|
||||
}
|
||||
|
||||
use 'folke/trouble.nvim'
|
||||
use 'mfussenegger/nvim-lint'
|
||||
|
||||
use 'nvimtools/none-ls.nvim'
|
||||
|
||||
-- to dap, or not to dap? tis the question
|
||||
--use 'mfussenegger/nvim-dap'
|
||||
--use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap", "nvim-neotest/nvim-nio"} }
|
||||
--[[
|
||||
use {
|
||||
"williamboman/mason.nvim",
|
||||
"mfussenegger/nvim-dap",
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
}
|
||||
--]]
|
||||
|
||||
use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })
|
||||
|
||||
-- use({
|
||||
|
|
|
@ -28,4 +28,6 @@ config.unix_domains = {
|
|||
},
|
||||
}
|
||||
|
||||
config.front_end = "OpenGL"
|
||||
|
||||
return config
|
||||
|
|
|
@ -2,13 +2,16 @@
|
|||
# may be moved to theme setter
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
listwalls=0
|
||||
unload=0
|
||||
secondary=""
|
||||
primary=""
|
||||
all=""
|
||||
|
||||
while getopts "up:s:a:" opt; do
|
||||
while getopts "lup:s:a:" opt; do
|
||||
case "$opt" in
|
||||
l) listwalls=1
|
||||
;;
|
||||
u) unload=1
|
||||
;;
|
||||
p) primary="$OPTARG"
|
||||
|
@ -23,6 +26,11 @@ done
|
|||
shift $((OPTIND-1))
|
||||
[ "${1:-}" = "--" ] && shift
|
||||
|
||||
if [ $listwalls == 1 ]; then
|
||||
ls ./wallpaper_scripts
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$all" ]; then
|
||||
primary="$all"
|
||||
secondary="$all"
|
||||
|
|
Loading…
Reference in New Issue