2024-05-27 20:12:04 +08:00
|
|
|
vim.cmd("set encoding=utf-8")
|
|
|
|
vim.cmd("set exrc")
|
2024-08-09 18:50:45 +08:00
|
|
|
vim.cmd("filetype off")
|
2024-05-07 17:27:20 +08:00
|
|
|
vim.cmd("set pumblend=40")
|
|
|
|
vim.cmd("set winblend=40")
|
2024-02-21 23:47:12 +08:00
|
|
|
vim.cmd("set expandtab")
|
2024-03-08 22:03:39 +08:00
|
|
|
vim.cmd("set tabstop=4")
|
|
|
|
vim.cmd("set softtabstop=4")
|
|
|
|
vim.cmd("set shiftwidth=4")
|
2024-02-21 23:47:12 +08:00
|
|
|
vim.cmd("set splitright")
|
|
|
|
vim.cmd("set splitbelow")
|
|
|
|
vim.cmd("set selectmode=key")
|
|
|
|
vim.cmd("set keymodel=startsel")
|
|
|
|
vim.cmd("set number")
|
|
|
|
vim.cmd("set cursorline")
|
|
|
|
vim.cmd("set termguicolors")
|
2024-02-22 00:13:31 +08:00
|
|
|
vim.cmd("set clipboard+=unnamedplus")
|
2024-03-08 22:03:39 +08:00
|
|
|
vim.cmd("set updatetime=700")
|
2024-02-22 11:57:27 +08:00
|
|
|
vim.cmd("set whichwrap+=<,>,[,]")
|
2024-02-26 20:01:57 +08:00
|
|
|
vim.cmd("set relativenumber")
|
2024-03-08 20:06:09 +08:00
|
|
|
vim.cmd("set signcolumn=yes")
|
|
|
|
-- vim.cmd("set iskeyword-=_")
|
|
|
|
vim.cmd("set noequalalways")
|
2024-05-07 17:27:20 +08:00
|
|
|
vim.cmd("set cmdheight=0")
|
2024-05-27 20:12:04 +08:00
|
|
|
vim.cmd("set scrolloff=10")
|
2024-08-09 18:50:45 +08:00
|
|
|
-- vim.cmd("set foldmethod=expr")
|
|
|
|
-- vim.cmd("set foldexpr=nvim_treesitter#foldexpr()")
|
|
|
|
-- vim.cmd("set foldlevelstart=99")
|
2024-07-04 23:27:18 +08:00
|
|
|
vim.cmd("set list")
|
2024-07-13 18:26:04 +08:00
|
|
|
vim.cmd("set listchars=trail:█")
|
2024-07-20 00:38:37 +08:00
|
|
|
vim.cmd("set guicursor=n-v-c:block,i:ver25,a:blinkon0")
|
2024-08-09 18:50:45 +08:00
|
|
|
vim.cmd("set guifont=BerkeleyMono\\ Nerd\\ Font")
|
2024-05-28 15:09:37 +08:00
|
|
|
vim.cmd("set noshowmode")
|
2024-02-22 11:57:27 +08:00
|
|
|
vim.diagnostic.config({
|
2024-08-09 18:50:45 +08:00
|
|
|
virtual_text = false,
|
2024-02-22 11:57:27 +08:00
|
|
|
update_in_insert = true,
|
2024-05-07 17:27:20 +08:00
|
|
|
float = {
|
|
|
|
border = "none",
|
|
|
|
focusable = false,
|
|
|
|
},
|
2024-02-22 11:57:27 +08:00
|
|
|
})
|
2024-03-08 22:03:39 +08:00
|
|
|
vim.cmd([[au CursorHold * lua vim.diagnostic.open_float(0,{scope = "cursor"})]])
|
2024-03-22 01:07:19 +08:00
|
|
|
vim.g.mapleader = " ";
|
2024-05-01 23:31:38 +08:00
|
|
|
vim.filetype.add({
|
|
|
|
extension = {
|
|
|
|
ct = 'cpp',
|
|
|
|
},
|
|
|
|
})
|
2024-02-21 23:47:12 +08:00
|
|
|
|
|
|
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
2024-07-02 14:53:19 +08:00
|
|
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
2024-07-29 18:06:36 +08:00
|
|
|
vim.fn.system({
|
|
|
|
"git",
|
|
|
|
"clone",
|
|
|
|
"--filter=blob:none",
|
|
|
|
"https://github.com/folke/lazy.nvim.git",
|
|
|
|
"--branch=stable", -- latest stable release
|
|
|
|
lazypath,
|
|
|
|
})
|
2024-02-21 23:47:12 +08:00
|
|
|
end
|
|
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
|
|
|
|
local plugins = {
|
2024-05-31 00:05:21 +08:00
|
|
|
{ 'nvim-lua/plenary.nvim' },
|
|
|
|
{ 'rcarriga/nvim-notify' },
|
2024-02-21 23:47:12 +08:00
|
|
|
{
|
2024-03-08 22:03:39 +08:00
|
|
|
'nvim-telescope/telescope.nvim', tag = '0.1.5',
|
2024-04-18 10:52:27 +08:00
|
|
|
dependencies = {
|
|
|
|
{
|
|
|
|
"isak102/telescope-git-file-history.nvim",
|
|
|
|
dependencies = { "tpope/vim-fugitive" }
|
|
|
|
}
|
2024-06-18 10:37:20 +08:00
|
|
|
},
|
2024-02-21 23:47:12 +08:00
|
|
|
},
|
|
|
|
{"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"},
|
2024-06-12 16:49:34 +08:00
|
|
|
-- {
|
|
|
|
-- "nvim-neo-tree/neo-tree.nvim",
|
|
|
|
-- branch = "v3.x",
|
|
|
|
-- dependencies = {
|
|
|
|
-- "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
|
|
|
-- "MunifTanjim/nui.nvim",
|
|
|
|
-- "3rd/image.nvim",
|
|
|
|
-- }
|
|
|
|
-- },
|
2024-02-21 23:47:12 +08:00
|
|
|
{
|
|
|
|
'neovim/nvim-lspconfig',
|
|
|
|
dependencies = {
|
|
|
|
-- Automatically install LSPs to stdpath for neovim
|
|
|
|
{'williamboman/mason.nvim', config = true},
|
|
|
|
'williamboman/mason-lspconfig.nvim',
|
|
|
|
-- Useful status updates for LSP
|
|
|
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
|
|
|
{ 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
|
|
|
|
-- Additional lua configuration, makes nvim stuff amazing!
|
2024-06-04 18:02:32 +08:00
|
|
|
-- 'folke/neodev.nvim',
|
2024-02-21 23:47:12 +08:00
|
|
|
},
|
2024-05-02 13:31:31 +08:00
|
|
|
config = function(_, servers)
|
2024-07-29 18:06:36 +08:00
|
|
|
for server, opts in pairs(servers) do
|
|
|
|
require('lspconfig')[server].setup(opts)
|
|
|
|
end
|
2024-05-02 13:31:31 +08:00
|
|
|
end,
|
2024-02-21 23:47:12 +08:00
|
|
|
},
|
|
|
|
{
|
2024-03-08 22:03:39 +08:00
|
|
|
"hrsh7th/nvim-cmp",
|
2024-02-21 23:47:12 +08:00
|
|
|
dependencies = {
|
2024-03-08 22:03:39 +08:00
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
|
|
"hrsh7th/cmp-buffer",
|
|
|
|
"hrsh7th/cmp-path",
|
|
|
|
"hrsh7th/cmp-cmdline",
|
|
|
|
"L3MON4D3/LuaSnip",
|
|
|
|
"saadparwaiz1/cmp_luasnip",
|
|
|
|
"hrsh7th/cmp-emoji",
|
2024-05-28 15:09:37 +08:00
|
|
|
"chrisgrieser/cmp-nerdfont",
|
|
|
|
"hrsh7th/cmp-calc",
|
2024-02-21 23:47:12 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'romgrk/barbar.nvim',
|
|
|
|
dependencies = {
|
2024-03-08 22:03:39 +08:00
|
|
|
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
2024-02-21 23:47:12 +08:00
|
|
|
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
|
|
|
},
|
|
|
|
init = function() vim.g.barbar_auto_setup = false end,
|
|
|
|
opts = {
|
2024-07-29 18:06:36 +08:00
|
|
|
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
|
|
|
animation = false,
|
|
|
|
-- insert_at_start = true,
|
|
|
|
-- …etc.
|
2024-02-21 23:47:12 +08:00
|
|
|
},
|
2024-03-08 22:03:39 +08:00
|
|
|
version = '^1.0.0', -- optional: only update when a new 1.x version is released
|
2024-02-21 23:47:12 +08:00
|
|
|
},
|
|
|
|
{
|
2024-06-04 18:02:32 +08:00
|
|
|
"ray-x/lsp_signature.nvim", -- Show signature on `K` stroke
|
2024-02-21 23:47:12 +08:00
|
|
|
event = "VeryLazy",
|
|
|
|
opts = {},
|
|
|
|
config = function(_, opts) require'lsp_signature'.setup(opts) end
|
|
|
|
},
|
2024-08-21 16:24:01 +08:00
|
|
|
-- {
|
|
|
|
-- "folke/which-key.nvim",
|
|
|
|
-- event = "VeryLazy",
|
|
|
|
-- init = function()
|
|
|
|
-- vim.o.timeout = true
|
|
|
|
-- vim.o.timeoutlen = 300
|
|
|
|
-- end,
|
|
|
|
-- opts = {
|
|
|
|
-- -- your configuration comes here
|
|
|
|
-- -- or leave it empty to use the default settings
|
|
|
|
-- -- refer to the configuration section below
|
|
|
|
-- }
|
|
|
|
-- },
|
2024-06-12 16:49:34 +08:00
|
|
|
{
|
2024-06-04 18:02:32 +08:00
|
|
|
'jdhao/better-escape.vim' -- `jk` without causing `j` to have delay
|
|
|
|
},
|
2024-05-28 15:09:37 +08:00
|
|
|
{
|
2024-03-08 22:03:39 +08:00
|
|
|
'Pocco81/auto-save.nvim',
|
2024-02-21 23:47:12 +08:00
|
|
|
opts = {
|
|
|
|
enabled = true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"windwp/nvim-autopairs",
|
|
|
|
event = "InsertEnter",
|
|
|
|
opts = {}
|
|
|
|
},
|
|
|
|
{
|
2024-06-04 18:02:32 +08:00
|
|
|
"dhruvasagar/vim-prosession", -- save sessions
|
2024-02-21 23:47:12 +08:00
|
|
|
dependencies = {
|
|
|
|
"tpope/vim-obsession",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"arielherself/arshamiser.nvim", -- status bar
|
2024-05-27 20:12:04 +08:00
|
|
|
branch = "dev",
|
2024-07-29 18:06:36 +08:00
|
|
|
dependencies = {
|
|
|
|
"arsham/arshlib.nvim",
|
|
|
|
"famiu/feline.nvim",
|
|
|
|
"rebelot/heirline.nvim",
|
|
|
|
"nvim-tree/nvim-web-devicons",
|
|
|
|
"lewis6991/gitsigns.nvim",
|
|
|
|
"nanotee/sqls.nvim",
|
|
|
|
"arsham/listish.nvim",
|
|
|
|
},
|
|
|
|
config = function()
|
2024-05-24 13:33:42 +08:00
|
|
|
require('gitsigns').setup()
|
|
|
|
|
2024-07-29 18:06:36 +08:00
|
|
|
-- ignore any parts you don't want to use
|
|
|
|
vim.cmd.colorscheme("arshamiser_dark")
|
|
|
|
-- require("arshamiser.feliniser")
|
|
|
|
-- or:
|
|
|
|
require("arshamiser.heirliniser")
|
2024-02-21 23:47:12 +08:00
|
|
|
|
2024-07-29 18:06:36 +08:00
|
|
|
_G.custom_foldtext = require("arshamiser.folding").foldtext
|
|
|
|
vim.opt.foldtext = "v:lua.custom_foldtext()"
|
|
|
|
-- if you want to draw a tabline:
|
|
|
|
-- vim.api.nvim_set_option("tabline", [[%{%v:lua.require("arshamiser.tabline").draw()%}]])
|
|
|
|
end,
|
2024-02-22 00:33:41 +08:00
|
|
|
},
|
|
|
|
{
|
2024-06-04 18:02:32 +08:00
|
|
|
'numToStr/Comment.nvim', -- `gc` for commenting
|
2024-02-22 00:33:41 +08:00
|
|
|
opts = {
|
|
|
|
-- add any options here
|
|
|
|
},
|
|
|
|
lazy = false,
|
2024-02-22 11:57:27 +08:00
|
|
|
},
|
2024-06-04 18:02:32 +08:00
|
|
|
{
|
2024-07-02 14:53:19 +08:00
|
|
|
-- dir = "/home/user/lspkind.nvim/",
|
|
|
|
'arielherself/lspkind.nvim' -- icon in completion menu
|
2024-06-04 18:02:32 +08:00
|
|
|
},
|
2024-02-22 11:57:27 +08:00
|
|
|
{
|
|
|
|
'MunifTanjim/eslint.nvim',
|
|
|
|
dependencies = {
|
2024-07-13 18:26:04 +08:00
|
|
|
'nvimtools/none-ls.nvim'
|
2024-02-22 11:57:27 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'MunifTanjim/prettier.nvim',
|
|
|
|
dependencies = {
|
2024-07-13 18:26:04 +08:00
|
|
|
'nvimtools/none-ls.nvim'
|
2024-02-22 11:57:27 +08:00
|
|
|
}
|
|
|
|
},
|
2024-06-04 18:02:32 +08:00
|
|
|
{
|
|
|
|
'hedyhli/outline.nvim' -- Show symbol outline on `<leader>s`
|
|
|
|
},
|
2024-02-22 11:57:27 +08:00
|
|
|
{
|
|
|
|
"folke/todo-comments.nvim",
|
|
|
|
opts = {
|
|
|
|
-- your configuration comes here
|
|
|
|
-- or leave it empty to use the default settings
|
|
|
|
-- refer to the configuration section below
|
|
|
|
}
|
2024-02-26 20:01:57 +08:00
|
|
|
},
|
|
|
|
{ 'nvim-treesitter/nvim-treesitter-context' },
|
2024-06-04 18:02:32 +08:00
|
|
|
{ 'nvim-treesitter/nvim-treesitter-refactor' },
|
|
|
|
{ 'nvim-treesitter/nvim-treesitter-textobjects' },
|
2024-03-08 22:03:39 +08:00
|
|
|
{ 'mg979/vim-visual-multi' },
|
2024-03-05 11:44:37 +08:00
|
|
|
{ 'sindrets/diffview.nvim' },
|
|
|
|
{
|
2024-06-04 18:02:32 +08:00
|
|
|
'sitiom/nvim-numbertoggle' -- Automatically switch between relative and absolute line number
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'mawkler/modicator.nvim' -- highlight current line number
|
|
|
|
},
|
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"ecthelionvi/NeoColumn.nvim", -- highlight overflow columns?
|
|
|
|
opts = {}
|
2024-03-05 11:44:37 +08:00
|
|
|
},
|
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"utilyre/barbecue.nvim", -- LSP winbar
|
|
|
|
name = "barbecue",
|
|
|
|
version = "*",
|
|
|
|
dependencies = {
|
|
|
|
"SmiteshP/nvim-navic",
|
|
|
|
"nvim-tree/nvim-web-devicons", -- optional dependency
|
|
|
|
},
|
|
|
|
opts = {
|
|
|
|
-- configurations go here
|
|
|
|
},
|
2024-03-05 11:44:37 +08:00
|
|
|
},
|
2024-06-04 18:02:32 +08:00
|
|
|
{
|
|
|
|
'akinsho/git-conflict.nvim', -- `GitConflictChooseOurs`
|
|
|
|
version = "*",
|
|
|
|
config = true,
|
|
|
|
},
|
2024-03-05 11:44:37 +08:00
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
'mrjones2014/legendary.nvim',
|
|
|
|
-- since legendary.nvim handles all your keymaps/commands,
|
|
|
|
-- its recommended to load legendary.nvim before other plugins
|
|
|
|
priority = 10000,
|
|
|
|
lazy = false,
|
|
|
|
-- sqlite is only needed if you want to use frecency sorting
|
|
|
|
-- dependencies = { 'kkharji/sqlite.lua' }
|
2024-03-05 11:44:37 +08:00
|
|
|
},
|
2024-06-01 16:28:14 +08:00
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
'stevearc/dressing.nvim', -- better UI
|
|
|
|
opts = {},
|
2024-06-01 16:28:14 +08:00
|
|
|
},
|
2024-03-05 11:44:37 +08:00
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"folke/twilight.nvim", -- Focus on parts that's being edited
|
|
|
|
opts = {
|
|
|
|
-- your configuration comes here
|
|
|
|
-- or leave it empty to use the default settings
|
|
|
|
-- refer to the configuration section below
|
|
|
|
}
|
2024-03-05 11:44:37 +08:00
|
|
|
},
|
|
|
|
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} },
|
2024-03-05 18:34:26 +08:00
|
|
|
{ 'arielherself/vim-cursorword' },
|
2024-03-05 17:21:18 +08:00
|
|
|
{ 'm-demare/hlargs.nvim' },
|
2024-06-04 18:02:32 +08:00
|
|
|
{
|
|
|
|
'chentoast/marks.nvim' -- Visualize marks
|
|
|
|
},
|
2024-03-05 19:20:29 +08:00
|
|
|
{ 'wakatime/vim-wakatime', lazy = false },
|
|
|
|
{
|
2024-03-08 22:03:39 +08:00
|
|
|
'smoka7/hop.nvim',
|
2024-03-05 19:20:29 +08:00
|
|
|
version = "*",
|
|
|
|
opts = {},
|
2024-03-08 20:06:09 +08:00
|
|
|
},
|
|
|
|
{
|
2024-06-04 18:02:32 +08:00
|
|
|
"kylechui/nvim-surround", -- `ysiw)`
|
2024-03-08 20:06:09 +08:00
|
|
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
|
|
|
event = "VeryLazy",
|
|
|
|
config = function()
|
|
|
|
require("nvim-surround").setup({
|
|
|
|
-- Configuration here, or leave empty to use defaults
|
|
|
|
})
|
|
|
|
end
|
2024-03-08 22:02:19 +08:00
|
|
|
},
|
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"folke/trouble.nvim", -- TroubleToggle
|
|
|
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
|
|
opts = {
|
|
|
|
-- your configuration comes here
|
|
|
|
-- or leave it empty to use the default settings
|
|
|
|
-- refer to the configuration section below
|
|
|
|
},
|
2024-03-14 23:58:45 +08:00
|
|
|
},
|
2024-08-06 13:11:39 +08:00
|
|
|
{
|
|
|
|
"arielherself/melange-nvim",
|
|
|
|
},
|
2024-04-18 10:52:27 +08:00
|
|
|
{ 'hrsh7th/vim-vsnip' },
|
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"NeogitOrg/neogit", -- <C-g>
|
|
|
|
dependencies = {
|
|
|
|
"sindrets/diffview.nvim", -- optional - Diff integration
|
2024-04-18 10:52:27 +08:00
|
|
|
|
2024-07-29 18:06:36 +08:00
|
|
|
-- Only one of these is needed, not both.
|
|
|
|
"nvim-telescope/telescope.nvim", -- optional
|
|
|
|
"ibhagwan/fzf-lua", -- optional
|
|
|
|
},
|
|
|
|
config = true
|
2024-04-18 10:52:27 +08:00
|
|
|
},
|
2024-05-02 13:31:31 +08:00
|
|
|
-- { 'Exafunction/codeium.vim' },
|
2024-06-04 18:02:32 +08:00
|
|
|
{
|
|
|
|
"mistricky/codesnap.nvim", -- code snapshot
|
|
|
|
build = "make"
|
|
|
|
},
|
2024-05-02 13:31:31 +08:00
|
|
|
{ 'rmagatti/goto-preview' },
|
2024-05-07 17:27:20 +08:00
|
|
|
{
|
2024-07-04 23:27:18 +08:00
|
|
|
-- dir = '/home/user/Documents/search.nvim',
|
|
|
|
"arielherself/search.nvim", -- Add tabs to Telescope search
|
2024-05-07 17:27:20 +08:00
|
|
|
dependencies = { "nvim-telescope/telescope.nvim" }
|
|
|
|
},
|
2024-06-04 18:02:32 +08:00
|
|
|
{
|
|
|
|
'NvChad/nvim-colorizer.lua' -- Color green
|
|
|
|
},
|
2024-05-24 13:33:42 +08:00
|
|
|
{ 'debugloop/telescope-undo.nvim' },
|
2024-05-31 00:05:21 +08:00
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"folke/lazydev.nvim", -- Autocompletion when editing Neovim configs or developing plugins
|
|
|
|
ft = "lua", -- only load on lua files
|
|
|
|
opts = {
|
|
|
|
library = {
|
|
|
|
-- lazypath .. "/luvit-meta/library", -- see below
|
|
|
|
-- You can also add plugins you always want to have loaded.
|
|
|
|
-- Useful if the plugin has globals or types you want to use
|
|
|
|
-- vim.env.LAZY .. "/LazyVim", -- see below
|
|
|
|
},
|
2024-06-04 18:02:32 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{ "Bilal2453/luvit-meta", lazy = true },
|
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"AckslD/nvim-neoclip.lua", -- `<leader>p`
|
2024-05-31 00:05:21 +08:00
|
|
|
},
|
2024-07-30 20:46:11 +08:00
|
|
|
-- {
|
|
|
|
-- "danielfalk/smart-open.nvim", -- sort file search results by frequency
|
|
|
|
-- branch = "0.2.x",
|
|
|
|
-- config = function()
|
|
|
|
-- require("telescope").load_extension("smart_open")
|
|
|
|
-- end,
|
|
|
|
-- dependencies = {
|
|
|
|
-- "kkharji/sqlite.lua",
|
|
|
|
-- -- Only required if using match_algorithm fzf
|
|
|
|
-- { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
|
|
|
-- -- Optional. If installed, native fzy will be used when match_algorithm is fzy
|
|
|
|
-- { "nvim-telescope/telescope-fzy-native.nvim" },
|
|
|
|
-- },
|
|
|
|
-- },
|
2024-08-09 18:50:45 +08:00
|
|
|
-- {
|
|
|
|
-- "chrisgrieser/nvim-origami", -- Fold keymap
|
|
|
|
-- event = "BufReadPost", -- later or on keypress would prevent saving folds
|
|
|
|
-- opts = true, -- needed even when using default config
|
|
|
|
-- },
|
2024-06-04 18:02:32 +08:00
|
|
|
{
|
2024-07-30 20:46:11 +08:00
|
|
|
-- dir = '/home/user/Documents/ultimate-autopair.nvim',
|
|
|
|
'altermo/ultimate-autopair.nvim',
|
2024-06-04 18:02:32 +08:00
|
|
|
event={'InsertEnter','CmdlineEnter'},
|
|
|
|
branch='v0.6', --recommended as each new version will have breaking changes
|
|
|
|
opts={
|
|
|
|
--Config goes here
|
|
|
|
bs = {
|
|
|
|
single_delete = true,
|
|
|
|
},
|
|
|
|
cr = {
|
|
|
|
autoclose = true,
|
|
|
|
},
|
|
|
|
close = {
|
|
|
|
enable = false,
|
|
|
|
},
|
|
|
|
tabout = {
|
|
|
|
enable = true,
|
|
|
|
map = '<M-Tab>',
|
|
|
|
hopout = true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2024-06-05 01:18:27 +08:00
|
|
|
{
|
2024-06-04 21:37:22 +08:00
|
|
|
'RRethy/nvim-treesitter-endwise' -- lua `end`
|
|
|
|
},
|
2024-06-05 01:18:27 +08:00
|
|
|
{
|
|
|
|
'rachartier/tiny-devicons-auto-colors.nvim',
|
|
|
|
dependencies = "nvim-tree/nvim-web-devicons",
|
|
|
|
event = "VeryLazy",
|
|
|
|
config = function()
|
|
|
|
require('tiny-devicons-auto-colors').setup {}
|
|
|
|
end,
|
|
|
|
},
|
2024-06-12 16:49:34 +08:00
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
'stevearc/oil.nvim',
|
|
|
|
opts = {},
|
|
|
|
-- Optional dependencies
|
|
|
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
2024-06-12 16:49:34 +08:00
|
|
|
},
|
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"aznhe21/actions-preview.nvim",
|
|
|
|
config = function()
|
|
|
|
vim.keymap.set({ "v", "n" }, "<leader>a", require("actions-preview").code_actions)
|
|
|
|
end,
|
2024-06-12 16:49:34 +08:00
|
|
|
},
|
2024-06-16 00:33:38 +08:00
|
|
|
{ "neovimhaskell/haskell-vim" },
|
|
|
|
{
|
2024-07-29 18:06:36 +08:00
|
|
|
"hedyhli/markdown-toc.nvim",
|
|
|
|
ft = "markdown", -- Lazy load on markdown filetype
|
|
|
|
cmd = { "Mtoc" }, -- Or, lazy load on "Mtoc" command
|
|
|
|
opts = {
|
|
|
|
-- Your configuration here (optional)
|
|
|
|
},
|
2024-06-16 00:33:38 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"iamcco/markdown-preview.nvim",
|
|
|
|
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
|
|
|
ft = { "markdown" },
|
|
|
|
build = function() vim.fn["mkdp#util#install"]() end,
|
|
|
|
},
|
2024-06-24 13:29:18 +08:00
|
|
|
{
|
|
|
|
'preservim/vim-markdown',
|
|
|
|
dependencies = { 'godlygeek/tabular' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'sourcegraph/sg.nvim',
|
|
|
|
},
|
2024-07-13 18:26:04 +08:00
|
|
|
{
|
|
|
|
"kawre/leetcode.nvim",
|
|
|
|
build = ":TSUpdate html",
|
|
|
|
dependencies = {
|
|
|
|
"nvim-telescope/telescope.nvim",
|
|
|
|
"nvim-lua/plenary.nvim", -- required by telescope
|
|
|
|
"MunifTanjim/nui.nvim",
|
|
|
|
|
|
|
|
-- optional
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
|
|
|
"rcarriga/nvim-notify",
|
|
|
|
"nvim-tree/nvim-web-devicons",
|
|
|
|
},
|
|
|
|
opts = {
|
|
|
|
-- configuration goes here
|
|
|
|
},
|
|
|
|
},
|
2024-07-25 13:20:58 +08:00
|
|
|
{
|
|
|
|
'MeanderingProgrammer/markdown.nvim',
|
|
|
|
main = "render-markdown",
|
|
|
|
opts = {},
|
|
|
|
name = 'render-markdown', -- Only needed if you have another plugin named markdown.nvim
|
|
|
|
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
|
|
|
|
},
|
2024-08-06 13:11:39 +08:00
|
|
|
{ 'echasnovski/mini.trailspace', version = '*' },
|
2024-08-09 18:50:45 +08:00
|
|
|
{ url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim' },
|
|
|
|
{ 'glacambre/firenvim', build = ":call firenvim#install(0)" },
|
2024-08-13 19:59:30 +08:00
|
|
|
{ 'nushell/tree-sitter-nu' },
|
2024-08-15 15:35:57 +08:00
|
|
|
{
|
|
|
|
"ibhagwan/fzf-lua",
|
|
|
|
-- optional for icon support
|
|
|
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
|
|
config = function()
|
|
|
|
-- calling `setup` is optional for customization
|
|
|
|
require("fzf-lua").setup({})
|
|
|
|
end
|
|
|
|
},
|
|
|
|
{ 'NStefan002/screenkey.nvim' },
|
2024-02-21 23:47:12 +08:00
|
|
|
}
|
2024-05-31 00:05:21 +08:00
|
|
|
require("lazy").setup(plugins, {})
|
2024-02-21 23:47:12 +08:00
|
|
|
|
2024-05-31 00:05:21 +08:00
|
|
|
vim.notify = require("notify")
|
2024-02-21 23:47:12 +08:00
|
|
|
|
2024-03-29 08:46:25 +08:00
|
|
|
vim.cmd([[colorscheme melange]])
|
2024-02-21 23:47:12 +08:00
|
|
|
|
|
|
|
local builtin = require("telescope.builtin")
|
2024-06-20 23:30:15 +08:00
|
|
|
local ext = require("telescope").extensions
|
2024-05-07 17:27:20 +08:00
|
|
|
require('search').setup {
|
|
|
|
append_tabs = {
|
2024-06-20 23:30:15 +08:00
|
|
|
{
|
|
|
|
'Symbols',
|
2024-07-02 14:53:19 +08:00
|
|
|
builtin.lsp_dynamic_workspace_symbols,
|
2024-06-20 23:30:15 +08:00
|
|
|
},
|
2024-05-07 17:27:20 +08:00
|
|
|
{
|
|
|
|
'Commits',
|
|
|
|
builtin.git_commits,
|
|
|
|
available = function()
|
|
|
|
return vim.fn.isdirectory('.git') == 1
|
|
|
|
end
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'File History',
|
|
|
|
builtin.git_file_history,
|
|
|
|
available = function()
|
|
|
|
return vim.fn.isdirectory('.git') == 1
|
|
|
|
end
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'Branches',
|
|
|
|
builtin.git_branches,
|
|
|
|
available = function()
|
|
|
|
return vim.fn.isdirectory('.git') == 1
|
|
|
|
end
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'Stash',
|
|
|
|
builtin.git_stash,
|
|
|
|
available = function()
|
|
|
|
return vim.fn.isdirectory('.git') == 1
|
|
|
|
end
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'Status',
|
|
|
|
builtin.git_status,
|
|
|
|
available = function()
|
|
|
|
return vim.fn.isdirectory('.git') == 1
|
|
|
|
end
|
|
|
|
},
|
2024-07-30 20:46:11 +08:00
|
|
|
-- {
|
|
|
|
-- 'Smart Open',
|
|
|
|
-- ext.smart_open.smart_open,
|
|
|
|
-- },
|
2024-06-20 23:30:15 +08:00
|
|
|
{
|
|
|
|
'Buffers',
|
|
|
|
builtin.buffers,
|
|
|
|
},
|
2024-05-07 17:27:20 +08:00
|
|
|
}
|
|
|
|
}
|
2024-06-20 23:30:15 +08:00
|
|
|
vim.keymap.set('n', '<leader>o', '<Cmd>lua require("search").open({ tab_name = "Smart Open" })<CR>')
|
|
|
|
vim.keymap.set('n', '<leader>f', '<Cmd>lua require("search").open({ tab_name = "Symbols" })<CR>')
|
2024-06-01 16:28:14 +08:00
|
|
|
vim.keymap.set('n', '<leader>g', '<Cmd>lua require("search").open({ tab_name = "Grep" })<CR>')
|
2024-02-21 23:47:12 +08:00
|
|
|
|
|
|
|
local config = require("nvim-treesitter.configs")
|
|
|
|
config.setup({
|
2024-02-22 11:57:27 +08:00
|
|
|
ensure_installed = {"lua", "cpp", "rust", "javascript", "python", "typescript", "html", "css", "scss"},
|
2024-02-21 23:47:12 +08:00
|
|
|
auto_install = true,
|
|
|
|
highlight = { enable = true},
|
|
|
|
indent = { enable = true},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- import nvim-cmp plugin safely
|
|
|
|
local cmp_status, cmp = pcall(require, "cmp")
|
|
|
|
if not cmp_status then
|
2024-07-29 18:06:36 +08:00
|
|
|
return
|
2024-02-21 23:47:12 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
-- import luasnip plugin safely
|
|
|
|
local luasnip_status, luasnip = pcall(require, "luasnip")
|
|
|
|
if not luasnip_status then
|
2024-07-29 18:06:36 +08:00
|
|
|
return
|
2024-02-21 23:47:12 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
vim.opt.completeopt = "menu,menuone,noselect"
|
|
|
|
|
2024-03-29 08:46:25 +08:00
|
|
|
local has_words_before = function()
|
2024-07-29 18:06:36 +08:00
|
|
|
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
|
2024-03-29 08:46:25 +08:00
|
|
|
end
|
|
|
|
|
2024-07-29 18:06:36 +08:00
|
|
|
local is_empty_line = function()
|
|
|
|
unpack = unpack or table.unpack
|
|
|
|
local line, _ = unpack(vim.api.nvim_win_get_cursor(0))
|
|
|
|
return vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:match("%S") == nil
|
2024-03-29 08:46:25 +08:00
|
|
|
end
|
|
|
|
|
2024-07-29 18:06:36 +08:00
|
|
|
local feedkey = function(key, mode)
|
|
|
|
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
|
|
|
end
|
2024-03-29 08:46:25 +08:00
|
|
|
|
2024-07-02 14:53:19 +08:00
|
|
|
cmp.setup {
|
|
|
|
snippet = {
|
|
|
|
expand = function(args)
|
|
|
|
luasnip.lsp_expand(args.body)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
mapping = {
|
|
|
|
["<Tab>"] = cmp.mapping(function(fallback)
|
|
|
|
if cmp.visible() then
|
2024-07-29 18:06:36 +08:00
|
|
|
if not is_empty_line() then
|
|
|
|
cmp.confirm({ select = true })
|
|
|
|
else
|
|
|
|
fallback()
|
|
|
|
end
|
2024-07-02 14:53:19 +08:00
|
|
|
elseif luasnip_status and luasnip.expand_or_jumpable() then
|
|
|
|
luasnip.expand_or_jump()
|
|
|
|
elseif has_words_before() then
|
|
|
|
cmp.complete()
|
|
|
|
else
|
|
|
|
fallback()
|
|
|
|
end
|
|
|
|
end, { "i", "s" }),
|
2024-03-29 08:46:25 +08:00
|
|
|
|
2024-07-02 14:53:19 +08:00
|
|
|
["<S-Tab>"] = cmp.mapping(function()
|
|
|
|
if cmp.visible() then
|
|
|
|
cmp.select_prev_item()
|
|
|
|
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
|
|
|
feedkey("<Plug>(vsnip-jump-prev)", "")
|
|
|
|
end
|
|
|
|
end, { "i", "s" }),
|
|
|
|
|
|
|
|
['<C-k>'] = cmp.mapping.select_prev_item(),
|
|
|
|
['<C-j>'] = cmp.mapping.select_next_item(),
|
|
|
|
['<ESC>'] = cmp.mapping.abort(),
|
|
|
|
},
|
|
|
|
-- sources for autocompletion
|
|
|
|
sources = cmp.config.sources({
|
|
|
|
{ name = "cody" },
|
|
|
|
{
|
|
|
|
name = "nvim_lsp",
|
|
|
|
option = {
|
|
|
|
markdown_oxide = { keyword_pattern = [[\(\k\| \|\/\|#\)\+]] }
|
|
|
|
}
|
|
|
|
}, -- LSP
|
|
|
|
{ name = "luasnip" }, -- snippets
|
|
|
|
{ name = "buffer" }, -- text within the current buffer
|
|
|
|
{ name = "path" }, -- file system paths
|
|
|
|
{ name = "emoji" },
|
|
|
|
{ name = "nerdfont" },
|
|
|
|
{ name = "calc" },
|
|
|
|
}),
|
|
|
|
}
|
2024-02-21 23:47:12 +08:00
|
|
|
|
|
|
|
-- Setup language servers.
|
|
|
|
local lspconfig = require('lspconfig')
|
2024-03-06 20:24:37 +08:00
|
|
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
2024-06-16 00:33:38 +08:00
|
|
|
-- local extended_caps = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities)
|
2024-05-07 17:27:20 +08:00
|
|
|
-- lspconfig.svls.setup {
|
|
|
|
-- capabilities = capabilities
|
|
|
|
-- }
|
2024-02-22 00:13:31 +08:00
|
|
|
lspconfig.clangd.setup {
|
2024-03-06 20:24:37 +08:00
|
|
|
capabilities = capabilities,
|
2024-08-15 15:35:57 +08:00
|
|
|
root_dir = function(fname)
|
|
|
|
return lspconfig.util.root_pattern('compile_commands.json')(fname) or lspconfig.util.find_git_ancestor(fname) or vim.fn.getcwd()
|
|
|
|
end,
|
2024-02-22 00:13:31 +08:00
|
|
|
cmd = {
|
|
|
|
"clangd",
|
2024-05-01 23:31:38 +08:00
|
|
|
-- "--header-insertion=never"
|
2024-02-22 00:13:31 +08:00
|
|
|
}
|
|
|
|
}
|
2024-03-06 20:24:37 +08:00
|
|
|
lspconfig.pyright.setup {
|
|
|
|
capabilities = capabilities
|
|
|
|
}
|
|
|
|
lspconfig.tsserver.setup {
|
|
|
|
capabilities = capabilities
|
|
|
|
}
|
2024-02-21 23:47:12 +08:00
|
|
|
lspconfig.rust_analyzer.setup {
|
2024-03-06 20:24:37 +08:00
|
|
|
capabilities = capabilities,
|
2024-07-29 18:06:36 +08:00
|
|
|
-- Server-specific settings. See `:help lspconfig-setup`
|
|
|
|
settings = {
|
|
|
|
['rust-analyzer'] = {
|
|
|
|
checkOnSave = {
|
|
|
|
command = 'clippy',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2024-02-21 23:47:12 +08:00
|
|
|
}
|
2024-06-10 02:39:41 +08:00
|
|
|
lspconfig.hls.setup {}
|
2024-05-02 13:31:31 +08:00
|
|
|
lspconfig.lua_ls.setup {
|
|
|
|
capabilities = capabilities
|
|
|
|
}
|
2024-06-05 01:04:44 +08:00
|
|
|
lspconfig.cmake.setup {}
|
2024-06-18 10:37:20 +08:00
|
|
|
lspconfig.asm_lsp.setup {
|
|
|
|
capabilities = capabilities
|
|
|
|
}
|
2024-07-04 00:02:50 +08:00
|
|
|
lspconfig.nil_ls.setup {
|
|
|
|
capabilities = capabilities
|
|
|
|
}
|
2024-07-13 18:26:04 +08:00
|
|
|
lspconfig.mojo.setup {}
|
2024-08-13 19:59:30 +08:00
|
|
|
lspconfig.nushell.setup {}
|
2024-02-21 23:47:12 +08:00
|
|
|
|
2024-06-16 00:33:38 +08:00
|
|
|
capabilities.workspace = {
|
|
|
|
didChangeWatchedFiles = {
|
2024-07-29 18:06:36 +08:00
|
|
|
dynamicRegistration = true,
|
2024-06-16 00:33:38 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
require("lspconfig").markdown_oxide.setup({
|
|
|
|
capabilities = capabilities, -- again, ensure that capabilities.workspace.didChangeWatchedFiles.dynamicRegistration = true
|
|
|
|
})
|
|
|
|
|
2024-05-07 17:27:20 +08:00
|
|
|
local lspconfutil = require 'lspconfig/util'
|
|
|
|
local root_pattern = lspconfutil.root_pattern("veridian.yml", ".git")
|
|
|
|
require('lspconfig').veridian.setup {
|
|
|
|
cmd = { 'veridian' },
|
|
|
|
root_dir = function(fname)
|
|
|
|
local filename = lspconfutil.path.is_absolute(fname) and fname
|
|
|
|
or lspconfutil.path.join(vim.loop.cwd(), fname)
|
|
|
|
return root_pattern(filename) or lspconfutil.path.dirname(filename)
|
|
|
|
end;
|
|
|
|
}
|
|
|
|
|
2024-02-21 23:47:12 +08:00
|
|
|
-- Global mappings.
|
|
|
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
|
|
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
|
|
|
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
|
|
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
|
|
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
|
|
|
|
|
|
|
|
-- Use LspAttach autocommand to only map the following keys
|
|
|
|
-- after the language server attaches to the current buffer
|
|
|
|
vim.api.nvim_create_autocmd('LspAttach', {
|
2024-07-29 18:06:36 +08:00
|
|
|
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
|
|
|
callback = function(ev)
|
|
|
|
-- Enable completion triggered by <c-x><c-o>
|
|
|
|
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
|
|
|
|
|
|
|
-- Buffer local mappings.
|
|
|
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
|
|
|
local opts = { buffer = ev.buf }
|
|
|
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
|
|
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
|
|
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
|
|
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
|
|
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
|
|
|
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
|
|
|
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
|
|
|
vim.keymap.set('n', '<space>wl', function()
|
|
|
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
|
|
|
end, opts)
|
|
|
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
|
|
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
|
|
|
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
|
|
|
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
|
|
|
end,
|
2024-02-21 23:47:12 +08:00
|
|
|
})
|
|
|
|
|
2024-05-15 15:02:50 +08:00
|
|
|
require("lsp_signature").setup({
|
|
|
|
handler_opts = { border = "none" },
|
2024-07-13 18:26:04 +08:00
|
|
|
hint_prefix = " ",
|
2024-05-15 15:02:50 +08:00
|
|
|
})
|
2024-02-21 23:47:12 +08:00
|
|
|
|
2024-03-06 20:24:37 +08:00
|
|
|
vim.keymap.set({'i', 'n', 'v', 'x'}, '<C-c>', '<ESC>', {noremap=true})
|
2024-02-21 23:47:12 +08:00
|
|
|
vim.keymap.set('i', '<C-x>', '<ESC>ddi')
|
2024-02-23 00:50:58 +08:00
|
|
|
vim.keymap.set('i', '<Home>', '<ESC>^i')
|
2024-02-21 23:47:12 +08:00
|
|
|
vim.keymap.set('i', '<C-a>', '<ESC>ggVG')
|
2024-02-22 00:18:11 +08:00
|
|
|
vim.keymap.set('n', '<C-a>', 'ggVG')
|
2024-08-13 19:59:30 +08:00
|
|
|
vim.keymap.set('n', '<leader>`', '<Cmd>split<CR><Cmd>terminal bash<CR>i')
|
2024-03-14 23:58:45 +08:00
|
|
|
vim.keymap.set('n', '<leader>n', '<Cmd>tabnew<CR>')
|
2024-07-04 00:02:50 +08:00
|
|
|
vim.keymap.set('n', '<leader><tab>', '<Cmd>tabnext<CR>')
|
2024-02-22 11:57:27 +08:00
|
|
|
vim.keymap.set('t', '<ESC>', '<C-\\><C-n>', {noremap=true})
|
2024-05-07 17:27:20 +08:00
|
|
|
vim.keymap.set('n', '<leader>s', '<Cmd>Outline<CR>')
|
2024-02-22 11:57:27 +08:00
|
|
|
vim.keymap.set("v", "<Tab>", ">gv")
|
|
|
|
vim.keymap.set("v", "<S-Tab>", "<gv")
|
2024-03-05 11:44:37 +08:00
|
|
|
vim.keymap.set('n', '<leader>t', '<Cmd>TodoTelescope<CR>')
|
2024-05-07 17:27:20 +08:00
|
|
|
vim.keymap.set('n', '<leader>m', '<Cmd>Tele marks<CR>')
|
2024-07-20 00:38:37 +08:00
|
|
|
vim.keymap.set('v', "<C-j>", "dpV`]", {noremap=true})
|
|
|
|
vim.keymap.set('v', "<C-k>", "dkPV`]", {noremap=true})
|
2024-03-05 11:44:37 +08:00
|
|
|
vim.keymap.set('n', '<C-p>', '<Cmd>Legendary<CR>', {noremap=true})
|
2024-03-08 20:06:09 +08:00
|
|
|
vim.keymap.set({'n', 'v', 'x'}, '<leader>h', '<Cmd>HopWord<CR>')
|
2024-06-10 02:39:41 +08:00
|
|
|
vim.keymap.set('n', '<leader>dd', '<Cmd>Trouble diagnostics toggle focus=true filter.buf=0<CR>');
|
|
|
|
vim.keymap.set('n', '<leader>dw', '<Cmd>Trouble diagnostics toggle focus=true<CR>');
|
|
|
|
vim.keymap.set('n', '<leader>dq', '<Cmd>Trouble qflist toggle focus=true<CR>');
|
|
|
|
vim.keymap.set('n', '<leader>w', '<Cmd>Trouble lsp toggle focus=true<CR>');
|
2024-04-18 10:52:27 +08:00
|
|
|
vim.keymap.set('n', '<A-t>', '<Cmd>BufferPick<CR>', {noremap=true});
|
2024-05-07 17:27:20 +08:00
|
|
|
vim.keymap.set('n', '<C-g>', '<Cmd>Neogit kind=split_above<CR>', {noremap=true});
|
2024-05-01 23:31:38 +08:00
|
|
|
vim.keymap.set({'v', 'x'}, '<leader>cc', '<Cmd>CodeSnap<CR>', {noremap=true});
|
2024-05-22 11:50:35 +08:00
|
|
|
vim.keymap.set('n', '<C-s>', '<Cmd>PopupSaveas<CR>', {noremap=true});
|
2024-05-24 13:33:42 +08:00
|
|
|
vim.keymap.set('n', '<S-U>', '<Cmd>Telescope undo<CR>', {noremap=true})
|
2024-07-20 00:38:37 +08:00
|
|
|
vim.keymap.set('i', '<C-E>', '{<ESC>A}<ESC>%li<CR><ESC>$i<CR><ESC>k^i', {noremap=true})
|
2024-05-27 20:12:04 +08:00
|
|
|
vim.keymap.set('n', '<C-BS>', 'd0i<BS><ESC>l', {noremap=true})
|
|
|
|
vim.keymap.set('i', '<C-BS>', '<C-u><BS>', {noremap=true})
|
2024-05-28 15:09:37 +08:00
|
|
|
vim.keymap.set('n', '<leader><leader>', '<Cmd>Telescope help_tags<CR>', {noremap=true})
|
2024-05-31 00:05:21 +08:00
|
|
|
vim.keymap.set('n', '<leader>p', '<Cmd>Telescope neoclip a extra=plus,unnamedplus<CR>', {noremap=true})
|
2024-06-10 02:39:41 +08:00
|
|
|
vim.keymap.set('n', '<leader>k', '<Cmd>SearchInCurrentFile<CR>')
|
2024-06-24 13:29:18 +08:00
|
|
|
vim.keymap.set('c', '<C-j>', '<Down>')
|
|
|
|
vim.keymap.set('c', '<C-k>', '<Up>')
|
2024-08-06 13:11:39 +08:00
|
|
|
vim.keymap.set('n', '<leader>x', require("mini.trailspace").trim, {noremap=true})
|
2024-07-13 18:26:04 +08:00
|
|
|
vim.keymap.set('n', '<Del>', vim.notify.dismiss, {noremap=true})
|
2024-08-07 00:22:47 +08:00
|
|
|
vim.keymap.set({'n', 'v', 'x'}, 'Q', 'q', {noremap=true})
|
|
|
|
vim.keymap.set({'n', 'v', 'x'}, 'q', '<Nop>', {noremap=true})
|
2024-06-04 18:02:32 +08:00
|
|
|
|
|
|
|
vim.api.nvim_create_user_command('SearchInCurrentFile', function()
|
2024-06-10 02:39:41 +08:00
|
|
|
vim.ui.input({ prompt = 'Grep ...'}, function(input)
|
2024-06-04 18:02:32 +08:00
|
|
|
if input ~= nil then
|
|
|
|
vim.cmd('vimgrep /' .. input .. '/j %')
|
|
|
|
vim.cmd('horizontal copen')
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
end, {})
|
2024-05-22 11:50:35 +08:00
|
|
|
|
|
|
|
vim.api.nvim_create_user_command('PopupSaveas', function()
|
2024-07-29 18:06:36 +08:00
|
|
|
vim.ui.input({ prompt = 'Save As: ' }, function(input)
|
|
|
|
if input ~= nil then
|
|
|
|
if vim.fn.filereadable(input) == 1 then
|
|
|
|
local choice = vim.fn.input('File exists. Overwrite? ([y]/n): ')
|
|
|
|
if choice ~= 'n' then
|
|
|
|
vim.cmd('saveas! ' .. input)
|
|
|
|
print('File overwritten: ' .. input)
|
|
|
|
else
|
|
|
|
print('Cancelled')
|
|
|
|
end
|
|
|
|
else
|
|
|
|
vim.cmd('saveas ' .. input)
|
|
|
|
print('File saved as: ' .. input)
|
|
|
|
end
|
2024-05-22 11:50:35 +08:00
|
|
|
else
|
2024-07-29 18:06:36 +08:00
|
|
|
print('Save As cancelled')
|
2024-05-22 11:50:35 +08:00
|
|
|
end
|
2024-07-29 18:06:36 +08:00
|
|
|
end)
|
2024-06-04 18:02:32 +08:00
|
|
|
end, {})
|
2024-04-18 10:52:27 +08:00
|
|
|
|
2024-02-22 12:28:27 +08:00
|
|
|
require("nvim-treesitter.configs").setup {
|
|
|
|
incremental_selection = {
|
|
|
|
enable = true,
|
|
|
|
keymaps = {
|
|
|
|
node_incremental = "v",
|
|
|
|
node_decremental = "V",
|
|
|
|
},
|
|
|
|
},
|
2024-06-04 18:02:32 +08:00
|
|
|
refactor = {
|
|
|
|
smart_rename = {
|
|
|
|
enable = true,
|
|
|
|
keymaps = { smart_rename = "grr" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
textobjects = {
|
|
|
|
select = {
|
2024-07-29 18:06:36 +08:00
|
|
|
enable = true,
|
|
|
|
lookahead = false,
|
|
|
|
keymaps = {
|
|
|
|
-- You can use the capture groups defined in textobjects.scm
|
|
|
|
["af"] = "@function.outer",
|
|
|
|
["if"] = "@function.inner",
|
|
|
|
["ac"] = "@class.outer",
|
|
|
|
-- You can optionally set descriptions to the mappings (used in the desc parameter of
|
|
|
|
-- nvim_buf_set_keymap) which plugins like which-key display
|
|
|
|
["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
|
|
|
|
-- You can also use captures from other query groups like `locals.scm`
|
|
|
|
["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
|
|
|
|
},
|
|
|
|
-- You can choose the select mode (default is charwise 'v')
|
|
|
|
--
|
|
|
|
-- Can also be a function which gets passed a table with the keys
|
|
|
|
-- * query_string: eg '@function.inner'
|
|
|
|
-- * method: eg 'v' or 'o'
|
|
|
|
-- and should return the mode ('v', 'V', or '<c-v>') or a table
|
|
|
|
-- mapping query_strings to modes.
|
|
|
|
selection_modes = {
|
|
|
|
['@parameter.outer'] = 'v', -- charwise
|
|
|
|
['@function.outer'] = 'V', -- linewise
|
|
|
|
['@class.outer'] = '<c-v>', -- blockwise
|
|
|
|
},
|
|
|
|
-- If you set this to `true` (default is `false`) then any textobject is
|
|
|
|
-- extended to include preceding or succeeding whitespace. Succeeding
|
|
|
|
-- whitespace has priority in order to act similarly to eg the built-in
|
|
|
|
-- `ap`.
|
|
|
|
--
|
|
|
|
-- Can also be a function which gets passed a table with the keys
|
|
|
|
-- * query_string: eg '@function.inner'
|
|
|
|
-- * selection_mode: eg 'v'
|
|
|
|
-- and should return true or false
|
|
|
|
include_surrounding_whitespace = false,
|
2024-06-04 18:02:32 +08:00
|
|
|
},
|
|
|
|
swap = {
|
2024-07-29 18:06:36 +08:00
|
|
|
enable = true,
|
|
|
|
swap_next = {
|
|
|
|
["]]"] = "@parameter.inner",
|
|
|
|
},
|
|
|
|
swap_previous = {
|
|
|
|
["[["] = "@parameter.inner",
|
|
|
|
},
|
2024-06-04 18:02:32 +08:00
|
|
|
},
|
|
|
|
move = {
|
2024-07-29 18:06:36 +08:00
|
|
|
enable = true,
|
|
|
|
set_jumps = true, -- whether to set jumps in the jumplist
|
|
|
|
goto_next_start = {
|
|
|
|
["]m"] = "@function.outer",
|
|
|
|
["]c"] = { query = "@class.outer", desc = "Next class start" },
|
|
|
|
--
|
|
|
|
-- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queires.
|
|
|
|
["]o"] = "@loop.*",
|
|
|
|
-- ["]o"] = { query = { "@loop.inner", "@loop.outer" } }
|
|
|
|
--
|
|
|
|
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
|
|
|
|
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm.
|
|
|
|
["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" },
|
|
|
|
["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" },
|
|
|
|
},
|
|
|
|
goto_next_end = {
|
|
|
|
["]M"] = "@function.outer",
|
|
|
|
["]C"] = "@class.outer",
|
|
|
|
},
|
|
|
|
goto_previous_start = {
|
|
|
|
["[m"] = "@function.outer",
|
|
|
|
["[c"] = "@class.outer",
|
|
|
|
},
|
|
|
|
goto_previous_end = {
|
|
|
|
["[M"] = "@function.outer",
|
|
|
|
["[C"] = "@class.outer",
|
|
|
|
},
|
|
|
|
-- Below will go to either the start or the end, whichever is closer.
|
|
|
|
-- Use if you want more granular movements
|
|
|
|
-- Make it even more gradual by adding multiple queries and regex.
|
|
|
|
goto_next = {
|
|
|
|
["]d"] = "@conditional.outer",
|
|
|
|
},
|
|
|
|
goto_previous = {
|
|
|
|
["[d"] = "@conditional.outer",
|
|
|
|
}
|
2024-06-04 18:02:32 +08:00
|
|
|
},
|
2024-06-04 21:37:22 +08:00
|
|
|
},
|
|
|
|
endwise = { enable = true, },
|
2024-02-22 12:28:27 +08:00
|
|
|
}
|
2024-02-21 23:47:12 +08:00
|
|
|
|
2024-06-04 18:02:32 +08:00
|
|
|
local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move"
|
|
|
|
|
|
|
|
-- Repeat movement with ; and ,
|
|
|
|
-- ensure ; goes forward and , goes backward regardless of the last direction
|
|
|
|
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next)
|
|
|
|
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous)
|
|
|
|
|
|
|
|
-- vim way: ; goes to the direction you were moving.
|
|
|
|
-- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
|
|
|
|
-- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
|
|
|
|
|
|
|
|
-- Optionally, make builtin f, F, t, T also repeatable with ; and ,
|
|
|
|
vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f_expr, { expr = true })
|
|
|
|
vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F_expr, { expr = true })
|
|
|
|
vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t_expr, { expr = true })
|
|
|
|
vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T_expr, { expr = true })
|
|
|
|
|
|
|
|
|
2024-03-22 01:07:19 +08:00
|
|
|
vim.api.nvim_create_user_command('Backup', '!git add . && git commit -S -m "backup" && git push', {})
|
2024-08-13 19:59:30 +08:00
|
|
|
vim.api.nvim_create_user_command('Config', 'e ~/dotfiles/nvim', {})
|
2024-03-08 22:02:19 +08:00
|
|
|
|
2024-02-22 00:33:41 +08:00
|
|
|
require('Comment').setup()
|
2024-02-22 11:57:27 +08:00
|
|
|
local str = require("cmp.utils.str")
|
|
|
|
local types = require("cmp.types")
|
|
|
|
local lspkind = require('lspkind')
|
|
|
|
cmp.setup {
|
|
|
|
formatting = {
|
2024-07-02 14:53:19 +08:00
|
|
|
fields = { cmp.ItemField.Abbr, cmp.ItemField.Kind, cmp.ItemField.Menu },
|
2024-02-22 11:57:27 +08:00
|
|
|
format = lspkind.cmp_format({
|
2024-07-02 14:53:19 +08:00
|
|
|
mode = 'symbol_text', -- show only symbol annotations
|
|
|
|
maxwidth = 30, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
2024-07-29 18:06:36 +08:00
|
|
|
-- can also be a function to dynamically calculate max width such as
|
|
|
|
-- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
|
2024-07-02 14:53:19 +08:00
|
|
|
ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
2024-02-22 11:57:27 +08:00
|
|
|
show_labelDetails = true, -- show labelDetails in menu. Disabled by default
|
|
|
|
|
|
|
|
-- The function below will be called before any actual modifications from lspkind
|
2024-03-08 22:03:39 +08:00
|
|
|
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
|
2024-02-22 11:57:27 +08:00
|
|
|
before = function (entry, vim_item)
|
2024-07-02 14:53:19 +08:00
|
|
|
-- local word = entry:get_insert_text()
|
|
|
|
-- if entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet then
|
|
|
|
-- word = word
|
|
|
|
-- -- word = vim.lsp.util.parse_snippet(word)
|
|
|
|
-- end
|
|
|
|
-- word = str.oneline(word)
|
|
|
|
-- if entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet and string.sub(vim_item.abbr, -1, -1) == "~" then
|
|
|
|
-- word = word .. "~"
|
|
|
|
-- end
|
|
|
|
-- vim_item.abbr = word
|
2024-02-22 11:57:27 +08:00
|
|
|
return vim_item
|
|
|
|
end
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
local null_ls = require("null-ls")
|
|
|
|
local eslint = require("eslint")
|
|
|
|
|
2024-06-20 23:30:15 +08:00
|
|
|
-- local group = vim.api.nvim_create_augroup("lsp_format_on_save", { clear = false })
|
|
|
|
-- local event = "BufWritePre" -- or "BufWritePost"
|
|
|
|
-- local async = event == "BufWritePost"
|
2024-02-22 11:57:27 +08:00
|
|
|
|
|
|
|
null_ls.setup()
|
|
|
|
|
|
|
|
eslint.setup({
|
2024-07-29 18:06:36 +08:00
|
|
|
bin = 'eslint', -- or `eslint_d`
|
|
|
|
code_actions = {
|
|
|
|
enable = true,
|
|
|
|
apply_on_save = {
|
|
|
|
enable = true,
|
|
|
|
types = { "directive", "problem", "suggestion", "layout" },
|
|
|
|
},
|
|
|
|
disable_rule_comment = {
|
|
|
|
enable = true,
|
|
|
|
location = "separate_line", -- or `same_line`
|
|
|
|
},
|
|
|
|
},
|
|
|
|
diagnostics = {
|
|
|
|
enable = true,
|
|
|
|
report_unused_disable_directives = false,
|
|
|
|
run_on = "type", -- or `save`
|
|
|
|
},
|
2024-02-22 11:57:27 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
local prettier = require("prettier")
|
|
|
|
|
|
|
|
prettier.setup({
|
2024-07-29 18:06:36 +08:00
|
|
|
bin = 'prettier', -- or `'prettierd'` (v0.23.3+)
|
|
|
|
filetypes = {
|
|
|
|
"css",
|
|
|
|
"graphql",
|
|
|
|
"html",
|
|
|
|
"javascript",
|
|
|
|
"javascriptreact",
|
|
|
|
"json",
|
|
|
|
"less",
|
|
|
|
"markdown",
|
|
|
|
"scss",
|
|
|
|
"typescript",
|
|
|
|
"typescriptreact",
|
|
|
|
"yaml",
|
|
|
|
"vue",
|
|
|
|
},
|
2024-02-22 11:57:27 +08:00
|
|
|
})
|
|
|
|
|
2024-05-07 17:27:20 +08:00
|
|
|
require("outline").setup()
|
2024-02-22 11:57:27 +08:00
|
|
|
|
|
|
|
require("todo-comments").setup()
|
2024-02-23 00:50:58 +08:00
|
|
|
|
|
|
|
lspconfig.volar.setup{
|
2024-07-29 18:06:36 +08:00
|
|
|
filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'}
|
2024-02-23 00:50:58 +08:00
|
|
|
}
|
2024-03-05 11:44:37 +08:00
|
|
|
|
|
|
|
local map = vim.api.nvim_set_keymap
|
|
|
|
local opts = { noremap = true, silent = true }
|
|
|
|
|
|
|
|
-- Move to previous/next
|
2024-06-16 00:33:38 +08:00
|
|
|
map('n', '<M-,>', '<Cmd>BufferPrevious<CR>', opts)
|
|
|
|
map('n', '<M-.>', '<Cmd>BufferNext<CR>', opts)
|
2024-03-05 11:44:37 +08:00
|
|
|
-- Re-order to previous/next
|
2024-05-24 13:33:42 +08:00
|
|
|
map('n', '<M-S-,>', '<Cmd>BufferMovePrevious<CR>', opts) -- Configuration for kitty
|
|
|
|
map('n', '<M-S-.>', '<Cmd>BufferMoveNext<CR>', opts)
|
2024-06-16 00:33:38 +08:00
|
|
|
map('n', '<M-p>', '<Cmd>BufferPin<CR>', opts);
|
|
|
|
map('n', '<M-c>', '<Cmd>BufferClose<CR>', opts)
|
2024-03-05 11:44:37 +08:00
|
|
|
|
|
|
|
require('diffview').setup()
|
|
|
|
|
|
|
|
require('modicator').setup()
|
|
|
|
|
|
|
|
require("barbecue.ui").toggle(true)
|
|
|
|
|
|
|
|
local highlight = {
|
|
|
|
"RainbowRed",
|
|
|
|
"RainbowYellow",
|
|
|
|
"RainbowBlue",
|
|
|
|
"RainbowOrange",
|
|
|
|
"RainbowGreen",
|
|
|
|
"RainbowViolet",
|
|
|
|
"RainbowCyan",
|
|
|
|
}
|
|
|
|
local hooks = require "ibl.hooks"
|
|
|
|
-- create the highlight groups in the highlight setup hook, so they are reset
|
|
|
|
-- every time the colorscheme changes
|
|
|
|
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
2024-03-08 22:03:39 +08:00
|
|
|
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
|
2024-03-05 11:44:37 +08:00
|
|
|
end)
|
|
|
|
|
|
|
|
require("ibl").setup {
|
|
|
|
indent = { highlight = highlight, char = "▏" },
|
|
|
|
scope = { enabled = true },
|
|
|
|
}
|
2024-03-05 17:21:18 +08:00
|
|
|
|
|
|
|
require('hlargs').setup()
|
|
|
|
|
|
|
|
require('marks').setup()
|
2024-03-05 19:20:29 +08:00
|
|
|
|
2024-05-02 13:31:31 +08:00
|
|
|
-- my snippets
|
|
|
|
require('snippets')
|
2024-03-22 01:07:19 +08:00
|
|
|
|
2024-06-12 16:49:34 +08:00
|
|
|
-- require('neo-tree').setup {
|
|
|
|
-- filesystem = {
|
|
|
|
-- filtered_items = {
|
|
|
|
-- visible = true, -- This is what you want: If you set this to `true`, all "hide" just mean "dimmed out"
|
|
|
|
-- hide_dotfiles = true,
|
|
|
|
-- hide_gitignored = true,
|
|
|
|
-- },
|
|
|
|
-- }
|
|
|
|
-- }
|
2024-03-22 01:07:19 +08:00
|
|
|
|
2024-04-18 10:52:27 +08:00
|
|
|
require('telescope').load_extension('git_file_history')
|
2024-05-24 13:33:42 +08:00
|
|
|
require('telescope').load_extension('undo')
|
2024-04-18 10:52:27 +08:00
|
|
|
|
2024-05-01 23:31:38 +08:00
|
|
|
require('codesnap').setup {
|
2024-07-13 18:26:04 +08:00
|
|
|
code_font_family = "BerkeleyMono Nerd Font",
|
2024-05-01 23:31:38 +08:00
|
|
|
has_line_number = true,
|
|
|
|
}
|
2024-05-02 13:31:31 +08:00
|
|
|
|
|
|
|
require('goto-preview').setup {
|
|
|
|
default_mappings = true;
|
|
|
|
}
|
|
|
|
|
2024-05-07 17:27:20 +08:00
|
|
|
require('colorizer').setup {}
|
2024-05-20 14:46:53 +08:00
|
|
|
|
|
|
|
require('ibl').setup {}
|
2024-05-24 13:33:42 +08:00
|
|
|
|
2024-05-27 20:12:04 +08:00
|
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
2024-06-20 23:30:15 +08:00
|
|
|
callback = function()
|
2024-05-27 20:12:04 +08:00
|
|
|
vim.lsp.inlay_hint.enable(true)
|
|
|
|
end,
|
|
|
|
})
|
2024-05-28 15:09:37 +08:00
|
|
|
|
2024-05-31 00:05:21 +08:00
|
|
|
require('neoclip').setup {}
|
2024-06-10 02:39:41 +08:00
|
|
|
|
2024-06-12 16:49:34 +08:00
|
|
|
require("oil").setup{
|
2024-07-29 18:06:36 +08:00
|
|
|
columns = {
|
|
|
|
"icon",
|
|
|
|
"permissions",
|
|
|
|
"size",
|
|
|
|
"mtime",
|
|
|
|
},
|
|
|
|
win_options = {
|
|
|
|
signcolumn = "yes",
|
|
|
|
},
|
|
|
|
view_options = {
|
|
|
|
show_hidden = true,
|
|
|
|
},
|
|
|
|
constrain_cursor = "editable",
|
|
|
|
keymaps = {
|
|
|
|
["<C-v>"] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" },
|
|
|
|
["<C-x>"] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" },
|
|
|
|
["<C-t>"] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" },
|
|
|
|
},
|
2024-06-12 16:49:34 +08:00
|
|
|
}
|
2024-06-16 00:33:38 +08:00
|
|
|
|
|
|
|
-- refresh codelens on TextChanged and InsertLeave as well
|
|
|
|
vim.api.nvim_create_autocmd({ 'TextChanged', 'InsertLeave', 'CursorHold', 'LspAttach' }, {
|
|
|
|
pattern = { "*.md" },
|
|
|
|
callback = vim.lsp.codelens.refresh,
|
|
|
|
})
|
|
|
|
|
|
|
|
-- trigger codelens refresh
|
|
|
|
vim.api.nvim_exec_autocmds('User', { pattern = 'LspAttached' })
|
2024-06-18 10:37:20 +08:00
|
|
|
|
|
|
|
require("telescope").setup {
|
|
|
|
defaults = {
|
2024-07-04 23:27:18 +08:00
|
|
|
layout_config = {
|
|
|
|
prompt_position = 'top',
|
|
|
|
},
|
|
|
|
sorting_strategy = 'ascending',
|
2024-06-18 10:37:20 +08:00
|
|
|
mappings = {
|
|
|
|
i = {
|
|
|
|
["<C-j>"] = require("telescope.actions").move_selection_next,
|
|
|
|
["<C-k>"] = require("telescope.actions").move_selection_previous,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2024-06-24 13:29:18 +08:00
|
|
|
|
2024-07-30 20:46:11 +08:00
|
|
|
-- NixOS cannot run this lsp
|
|
|
|
-- vim.env.SRC_ENDPOINT = 'https://sourcegraph.com/'
|
|
|
|
-- vim.env.SRC_ACCESS_TOKEN = '' -- TODO: fill in the token before using it
|
|
|
|
--
|
|
|
|
-- require('sg').setup {}
|
2024-07-02 14:53:19 +08:00
|
|
|
|
|
|
|
-- vim.diagnostic.config({ virtual_text = false })
|
2024-08-06 13:11:39 +08:00
|
|
|
|
|
|
|
require('mini.trailspace').setup {}
|
2024-08-09 18:50:45 +08:00
|
|
|
|
|
|
|
require('lsp_lines').setup {}
|