2024-05-11 22:24:18 +00:00
|
|
|
local paq = require "paq" {
|
2023-11-28 00:04:15 +00:00
|
|
|
'dense-analysis/ale',
|
|
|
|
'dracula/vim',
|
2024-07-23 03:01:36 +00:00
|
|
|
'ibhagwan/fzf-lua',
|
2024-01-31 14:58:15 +00:00
|
|
|
'kaarmu/typst.vim',
|
2023-11-28 00:04:15 +00:00
|
|
|
'lewis6991/gitsigns.nvim',
|
|
|
|
'lukas-reineke/indent-blankline.nvim',
|
|
|
|
'neovim/nvim-lspconfig',
|
2024-07-23 03:01:36 +00:00
|
|
|
'nmac427/guess-indent.nvim',
|
2023-11-28 00:04:15 +00:00
|
|
|
'nvim-lua/plenary.nvim',
|
|
|
|
'nvimtools/none-ls.nvim',
|
2024-01-31 14:58:15 +00:00
|
|
|
'stevearc/aerial.nvim',
|
2024-07-23 03:01:36 +00:00
|
|
|
|
2023-11-28 00:04:15 +00:00
|
|
|
'vim-airline/vim-airline',
|
2023-11-28 01:20:39 +00:00
|
|
|
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
2023-05-25 16:14:34 +00:00
|
|
|
|
2024-02-29 18:13:42 +00:00
|
|
|
'gbprod/none-ls-shellcheck.nvim',
|
|
|
|
|
2024-07-23 03:01:36 +00:00
|
|
|
"L3MON4D3/LuaSnip",
|
|
|
|
"hrsh7th/cmp-buffer",
|
|
|
|
"hrsh7th/cmp-cmdline",
|
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
|
|
"hrsh7th/cmp-nvim-lsp-signature-help",
|
|
|
|
"hrsh7th/cmp-path",
|
|
|
|
"hrsh7th/nvim-cmp",
|
2023-11-28 00:04:15 +00:00
|
|
|
|
2023-11-28 01:20:39 +00:00
|
|
|
'williamboman/mason-lspconfig.nvim',
|
|
|
|
{ 'williamboman/mason.nvim', build = ':MasonUpdate' },
|
2022-05-27 18:05:57 +00:00
|
|
|
}
|
2023-11-28 00:04:15 +00:00
|
|
|
|
2024-01-31 14:58:15 +00:00
|
|
|
require("aerial").setup()
|
2024-07-23 03:01:36 +00:00
|
|
|
require('guess-indent').setup()
|
2022-05-27 18:05:57 +00:00
|
|
|
require("gitsigns").setup()
|
2023-10-03 15:58:45 +00:00
|
|
|
require("ibl").setup()
|
2023-11-28 01:20:39 +00:00
|
|
|
require("mason").setup()
|
|
|
|
require("mason-lspconfig").setup()
|
2024-01-31 14:58:15 +00:00
|
|
|
require("nvim-treesitter.configs").setup({highlight = {enable = true}})
|
2023-11-28 01:20:39 +00:00
|
|
|
|
|
|
|
local null_ls = require("null-ls")
|
|
|
|
null_ls.setup({sources = {
|
|
|
|
null_ls.builtins.formatting.phpcbf,
|
|
|
|
null_ls.builtins.diagnostics.phpcs
|
|
|
|
}})
|
2024-02-29 18:13:42 +00:00
|
|
|
require("null-ls").register(require("none-ls-shellcheck.diagnostics"))
|
|
|
|
require("null-ls").register(require("none-ls-shellcheck.code_actions"))
|
2023-11-28 01:20:39 +00:00
|
|
|
|
2024-05-11 22:24:18 +00:00
|
|
|
-- makes cmp tab functionality work as expected
|
2023-11-28 01:20:39 +00:00
|
|
|
local has_words_before = function()
|
|
|
|
unpack = unpack or table.unpack
|
|
|
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
|
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
|
|
|
end
|
|
|
|
|
|
|
|
local cmp = require("cmp")
|
|
|
|
cmp.setup({
|
|
|
|
mapping = {
|
|
|
|
["<Tab>"] = cmp.mapping(
|
|
|
|
function (fallback)
|
|
|
|
if cmp.visible() then cmp.select_next_item()
|
|
|
|
elseif has_words_before() then cmp.complete()
|
|
|
|
else fallback() end
|
|
|
|
end, {"i"}),
|
|
|
|
|
|
|
|
["<S-Tab>"] = cmp.mapping( cmp.mapping.select_prev_item(), {"i"}),
|
|
|
|
["<Space>"] = cmp.mapping( cmp.mapping.confirm({select=true}), {"i"}),
|
|
|
|
},
|
|
|
|
|
|
|
|
completion = { autocomplete = false },
|
|
|
|
snippet = { expand = function(args) require("luasnip").lsp_expand(args.body) end },
|
|
|
|
|
|
|
|
sources = cmp.config.sources(
|
|
|
|
{{name = "nvim_lsp_signature_help"}},
|
|
|
|
{{name = "nvim_lsp"}},
|
|
|
|
{{name = "buffer"}},
|
|
|
|
{{name = "path"}}
|
|
|
|
)
|
|
|
|
})
|
|
|
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
|
|
require("lspconfig").clangd.setup{capabilities=capabilities}
|
|
|
|
require("mason-lspconfig").setup_handlers {
|
|
|
|
function (server_name)
|
|
|
|
require("lspconfig")[server_name].setup {capabilities=capabilities}
|
|
|
|
end
|
|
|
|
}
|
2022-05-27 18:05:57 +00:00
|
|
|
|
|
|
|
vim.opt.background = "dark"
|
|
|
|
vim.opt.clipboard = "unnamedplus"
|
|
|
|
vim.opt.colorcolumn = "85"
|
|
|
|
vim.opt.mouse = "a"
|
|
|
|
vim.opt.shiftwidth = 4
|
|
|
|
vim.opt.textwidth = 0
|
|
|
|
vim.opt.wrapmargin = 0
|
|
|
|
|
|
|
|
vim.opt.cursorline = true
|
|
|
|
vim.opt.expandtab = true
|
|
|
|
vim.opt.ignorecase = true
|
|
|
|
vim.opt.linebreak = true
|
|
|
|
vim.opt.number = true
|
|
|
|
vim.opt.smartcase = true
|
|
|
|
vim.opt.smartindent = true
|
|
|
|
vim.opt.termguicolors = true
|
|
|
|
vim.opt.wrap = false
|
|
|
|
|
|
|
|
vim.keymap.set('', '<F7>', 'mzgg=G`z')
|
|
|
|
vim.keymap.set('', 'r', '"_d')
|
2023-11-28 00:04:15 +00:00
|
|
|
vim.g.mapleader = " "
|
|
|
|
|
2024-01-31 14:58:15 +00:00
|
|
|
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
|
|
|
|
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
|
|
|
|
vim.keymap.set('n', '<leader>a', "<cmd>AerialToggle!<CR>")
|
2024-07-19 22:46:33 +00:00
|
|
|
vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end)
|
|
|
|
vim.keymap.set('n', 'gD', function() vim.lsp.buf.type_definition() end)
|
|
|
|
vim.keymap.set('n', '<leader>d', function() vim.lsp.buf.definition() end)
|
2023-11-28 00:04:15 +00:00
|
|
|
vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.code_action() end)
|
|
|
|
vim.keymap.set('n', '<leader>h', function() vim.lsp.buf.hover() end)
|
|
|
|
vim.keymap.set('n', '<leader>r', function() vim.lsp.buf.rename() end)
|
2022-05-27 18:05:57 +00:00
|
|
|
|
2024-07-23 03:01:36 +00:00
|
|
|
vim.keymap.set("n", "<C-p>", require('fzf-lua').files)
|
|
|
|
vim.keymap.set("n", "<leader>\\", require('fzf-lua').buffers)
|
|
|
|
vim.keymap.set("n", "<leader>k", require('fzf-lua').builtin)
|
|
|
|
vim.keymap.set("n", "<leader>l", require('fzf-lua').live_grep_glob)
|
|
|
|
vim.keymap.set("n", "<leader>g", require('fzf-lua').grep_project)
|
|
|
|
|
2022-05-27 18:05:57 +00:00
|
|
|
vim.cmd [[
|
|
|
|
colorscheme dracula
|
|
|
|
command Q q!
|
2023-11-28 01:20:39 +00:00
|
|
|
let b:ale_linters = {'c': [''], 'sh': [''], 'php': ['']}
|
2024-04-19 20:45:54 +00:00
|
|
|
autocmd BufReadPost,FileReadPost *.bz3 call gzip#read("bzip3 -rd")
|
2022-05-27 18:05:57 +00:00
|
|
|
]]
|