added custom configuration
This commit is contained in:
parent
2abcb39fae
commit
19b91ec1c5
60
init.lua
60
init.lua
|
@ -91,7 +91,7 @@ vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||||
vim.g.have_nerd_font = false
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.opt`
|
-- See `:help vim.opt`
|
||||||
|
@ -403,7 +403,11 @@ require('lazy').setup({
|
||||||
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
|
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
|
||||||
-- },
|
-- },
|
||||||
-- },
|
-- },
|
||||||
-- pickers = {}
|
pickers = {
|
||||||
|
find_files = {
|
||||||
|
hidden = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
extensions = {
|
extensions = {
|
||||||
['ui-select'] = {
|
['ui-select'] = {
|
||||||
require('telescope.themes').get_dropdown(),
|
require('telescope.themes').get_dropdown(),
|
||||||
|
@ -665,7 +669,7 @@ require('lazy').setup({
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
-- clangd = {},
|
||||||
-- gopls = {},
|
-- gopls = {},
|
||||||
-- pyright = {},
|
pyright = {},
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||||
--
|
--
|
||||||
|
@ -763,7 +767,7 @@ require('lazy').setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
-- python = { "isort", "black" },
|
python = { 'isort', 'black' },
|
||||||
--
|
--
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
@ -791,12 +795,12 @@ require('lazy').setup({
|
||||||
-- `friendly-snippets` contains a variety of premade snippets.
|
-- `friendly-snippets` contains a variety of premade snippets.
|
||||||
-- See the README about individual language/framework/plugin snippets:
|
-- See the README about individual language/framework/plugin snippets:
|
||||||
-- https://github.com/rafamadriz/friendly-snippets
|
-- https://github.com/rafamadriz/friendly-snippets
|
||||||
-- {
|
{
|
||||||
-- 'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
-- config = function()
|
config = function()
|
||||||
-- require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
-- end,
|
end,
|
||||||
-- },
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'saadparwaiz1/cmp_luasnip',
|
'saadparwaiz1/cmp_luasnip',
|
||||||
|
@ -839,13 +843,13 @@ require('lazy').setup({
|
||||||
-- Accept ([y]es) the completion.
|
-- Accept ([y]es) the completion.
|
||||||
-- This will auto-import if your LSP supports it.
|
-- This will auto-import if your LSP supports it.
|
||||||
-- This will expand snippets if the LSP sent a snippet.
|
-- This will expand snippets if the LSP sent a snippet.
|
||||||
['<C-y>'] = cmp.mapping.confirm { select = true },
|
-- ['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||||
|
|
||||||
-- If you prefer more traditional completion keymaps,
|
-- If you prefer more traditional completion keymaps,
|
||||||
-- you can uncomment the following lines
|
-- you can uncomment the following lines
|
||||||
--['<CR>'] = cmp.mapping.confirm { select = true },
|
['<CR>'] = cmp.mapping.confirm { select = true },
|
||||||
--['<Tab>'] = cmp.mapping.select_next_item(),
|
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||||
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||||
|
|
||||||
-- Manually trigger a completion from nvim-cmp.
|
-- Manually trigger a completion from nvim-cmp.
|
||||||
-- Generally you don't need this, because nvim-cmp will display
|
-- Generally you don't need this, because nvim-cmp will display
|
||||||
|
@ -889,28 +893,6 @@ require('lazy').setup({
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ -- You can easily change to a different colorscheme.
|
|
||||||
-- Change the name of the colorscheme plugin below, and then
|
|
||||||
-- change the command in the config to whatever the name of that colorscheme is.
|
|
||||||
--
|
|
||||||
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
|
||||||
'folke/tokyonight.nvim',
|
|
||||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
|
||||||
config = function()
|
|
||||||
---@diagnostic disable-next-line: missing-fields
|
|
||||||
require('tokyonight').setup {
|
|
||||||
styles = {
|
|
||||||
comments = { italic = false }, -- Disable italics in comments
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Load the colorscheme here.
|
|
||||||
-- Like many other themes, this one has different styles, and you could load
|
|
||||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
|
||||||
vim.cmd.colorscheme 'tokyonight-night'
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Highlight todo, notes, etc in comments
|
-- Highlight todo, notes, etc in comments
|
||||||
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
||||||
|
|
||||||
|
@ -986,8 +968,8 @@ require('lazy').setup({
|
||||||
-- Here are some example plugins that I've included in the Kickstart repository.
|
-- Here are some example plugins that I've included in the Kickstart repository.
|
||||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||||
--
|
--
|
||||||
-- require 'kickstart.plugins.debug',
|
require 'kickstart.plugins.debug',
|
||||||
-- require 'kickstart.plugins.indent_line',
|
require 'kickstart.plugins.indent_line',
|
||||||
-- require 'kickstart.plugins.lint',
|
-- require 'kickstart.plugins.lint',
|
||||||
-- require 'kickstart.plugins.autopairs',
|
-- require 'kickstart.plugins.autopairs',
|
||||||
-- require 'kickstart.plugins.neo-tree',
|
-- require 'kickstart.plugins.neo-tree',
|
||||||
|
@ -997,7 +979,7 @@ require('lazy').setup({
|
||||||
-- This is the easiest way to modularize your config.
|
-- This is the easiest way to modularize your config.
|
||||||
--
|
--
|
||||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||||
-- { import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
--
|
--
|
||||||
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||||
-- Or use telescope!
|
-- Or use telescope!
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
let s:cpo_save=&cpo
|
||||||
|
set cpo&vim
|
||||||
|
cnoremap <silent> <Plug>(TelescopeFuzzyCommandSearch) e "lua require('telescope.builtin').command_history { default_text = [=[" . escape(getcmdline(), '"') . "]=] }"
|
||||||
|
inoremap <C-W> u
|
||||||
|
inoremap <C-U> u
|
||||||
|
nnoremap
|
||||||
|
nnoremap <NL> <NL>
|
||||||
|
nnoremap
|
||||||
|
nnoremap
|
||||||
|
nmap d
|
||||||
|
tnoremap
|
||||||
|
nnoremap <Cmd>nohlsearch
|
||||||
|
omap <silent> % <Plug>(MatchitOperationForward)
|
||||||
|
xmap <silent> % <Plug>(MatchitVisualForward)
|
||||||
|
nmap <silent> % <Plug>(MatchitNormalForward)
|
||||||
|
nnoremap & :&&
|
||||||
|
xnoremap <silent> <expr> @ mode() ==# 'V' ? ':normal! @'.getcharstr().'
' : '@'
|
||||||
|
xnoremap <silent> <expr> Q mode() ==# 'V' ? ':normal! @=reg_recorded()
' : 'Q'
|
||||||
|
nnoremap Y y$
|
||||||
|
omap <silent> [% <Plug>(MatchitOperationMultiBackward)
|
||||||
|
xmap <silent> [% <Plug>(MatchitVisualMultiBackward)
|
||||||
|
nmap <silent> [% <Plug>(MatchitNormalMultiBackward)
|
||||||
|
omap <silent> ]% <Plug>(MatchitOperationMultiForward)
|
||||||
|
xmap <silent> ]% <Plug>(MatchitVisualMultiForward)
|
||||||
|
nmap <silent> ]% <Plug>(MatchitNormalMultiForward)
|
||||||
|
xmap a% <Plug>(MatchitVisualTextObject)
|
||||||
|
omap <silent> g% <Plug>(MatchitOperationBackward)
|
||||||
|
xmap <silent> g% <Plug>(MatchitVisualBackward)
|
||||||
|
nmap <silent> g% <Plug>(MatchitNormalBackward)
|
||||||
|
xnoremap <silent> sa :lua MiniSurround.add('visual')
|
||||||
|
nnoremap <Plug>PlenaryTestFile :lua require('plenary.test_harness').test_file(vim.fn.expand("%:p"))
|
||||||
|
xmap <silent> <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
|
||||||
|
onoremap <silent> <Plug>(MatchitOperationMultiForward) :call matchit#MultiMatch("W", "o")
|
||||||
|
onoremap <silent> <Plug>(MatchitOperationMultiBackward) :call matchit#MultiMatch("bW", "o")
|
||||||
|
xnoremap <silent> <Plug>(MatchitVisualMultiForward) :call matchit#MultiMatch("W", "n")
m'gv``
|
||||||
|
xnoremap <silent> <Plug>(MatchitVisualMultiBackward) :call matchit#MultiMatch("bW", "n")
m'gv``
|
||||||
|
nnoremap <silent> <Plug>(MatchitNormalMultiForward) :call matchit#MultiMatch("W", "n")
|
||||||
|
nnoremap <silent> <Plug>(MatchitNormalMultiBackward) :call matchit#MultiMatch("bW", "n")
|
||||||
|
onoremap <silent> <Plug>(MatchitOperationBackward) :call matchit#Match_wrapper('',0,'o')
|
||||||
|
onoremap <silent> <Plug>(MatchitOperationForward) :call matchit#Match_wrapper('',1,'o')
|
||||||
|
xnoremap <silent> <Plug>(MatchitVisualBackward) :call matchit#Match_wrapper('',0,'v')
m'gv``
|
||||||
|
xnoremap <silent> <Plug>(MatchitVisualForward) :call matchit#Match_wrapper('',1,'v')
:if col("''") != col("$") | exe ":normal! m'" | endif
gv``
|
||||||
|
nnoremap <silent> <Plug>(MatchitNormalBackward) :call matchit#Match_wrapper('',0,'n')
|
||||||
|
nnoremap <silent> <Plug>(MatchitNormalForward) :call matchit#Match_wrapper('',1,'n')
|
||||||
|
nnoremap <C-K>
|
||||||
|
nnoremap <C-J> <NL>
|
||||||
|
nnoremap <C-H>
|
||||||
|
nmap <C-W><C-D> d
|
||||||
|
nnoremap <C-L>
|
||||||
|
inoremap u
|
||||||
|
inoremap u
|
||||||
|
let &cpo=s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
set clipboard=unnamedplus
|
||||||
|
set confirm
|
||||||
|
set grepformat=%f:%l:%c:%m
|
||||||
|
set grepprg=rg\ --vimgrep\ -uu\
|
||||||
|
set helplang=en
|
||||||
|
set ignorecase
|
||||||
|
set inccommand=split
|
||||||
|
set listchars=nbsp:␣,tab:»\ ,trail:·
|
||||||
|
set noloadplugins
|
||||||
|
set mouse=a
|
||||||
|
set packpath=/opt/nvim-linux-x86_64/share/nvim/runtime
|
||||||
|
set runtimepath=~/.config/nvim,~/.local/share/nvim/lazy/lazy.nvim,~/.local/share/nvim/lazy/cmp-nvim-lsp-signature-help,~/.local/share/nvim/lazy/cmp-path,~/.local/share/nvim/lazy/cmp_luasnip,~/.local/share/nvim/lazy/friendly-snippets,~/.local/share/nvim/lazy/LuaSnip,~/.local/share/nvim/lazy/nvim-cmp,~/.local/share/nvim/lazy/todo-comments.nvim,~/.local/share/nvim/lazy/nvim-web-devicons,~/.local/share/nvim/lazy/telescope-ui-select.nvim,~/.local/share/nvim/lazy/telescope-fzf-native.nvim,~/.local/share/nvim/lazy/plenary.nvim,~/.local/share/nvim/lazy/telescope.nvim,~/.local/share/nvim/lazy/which-key.nvim,~/.local/share/nvim/lazy/mason-nvim-dap.nvim,~/.local/share/nvim/lazy/cmp-nvim-lsp,~/.local/share/nvim/lazy/fidget.nvim,~/.local/share/nvim/lazy/mason-tool-installer.nvim,~/.local/share/nvim/lazy/mason-lspconfig.nvim,~/.local/share/nvim/lazy/mason.nvim,~/.local/share/nvim/lazy/nvim-lspconfig,~/.local/share/nvim/lazy/gitsigns.nvim,~/.local/share/nvim/lazy/vim-sleuth,~/.local/share/nvim/lazy/indent-blankline.nvim,~/.local/share/nvim/lazy/nvim-treesitter,~/.local/share/nvim/lazy/mini.nvim,~/.local/share/nvim/lazy/tokyonight.nvim,/opt/nvim-linux-x86_64/share/nvim/runtime,/opt/nvim-linux-x86_64/share/nvim/runtime/pack/dist/opt/matchit,/opt/nvim-linux-x86_64/lib/nvim,~/.local/state/nvim/lazy/readme,~/.local/share/nvim/lazy/cmp-nvim-lsp-signature-help/after,~/.local/share/nvim/lazy/cmp-path/after,~/.local/share/nvim/lazy/cmp_luasnip/after,~/.local/share/nvim/lazy/cmp-nvim-lsp/after,~/.local/share/nvim/lazy/indent-blankline.nvim/after
|
||||||
|
set scrolloff=10
|
||||||
|
set noshowmode
|
||||||
|
set smartcase
|
||||||
|
set splitbelow
|
||||||
|
set splitright
|
||||||
|
set statusline=%{%(nvim_get_current_win()==#g:actual_curwin\ ||\ &laststatus==3)\ ?\ v:lua.MiniStatusline.active()\ :\ v:lua.MiniStatusline.inactive()%}
|
||||||
|
set termguicolors
|
||||||
|
set timeoutlen=300
|
||||||
|
set undofile
|
||||||
|
set updatetime=250
|
||||||
|
set window=83
|
||||||
|
" vim: set ft=vim :
|
|
@ -0,0 +1,13 @@
|
||||||
|
return {
|
||||||
|
'catppuccin/nvim',
|
||||||
|
name = 'catppuccin',
|
||||||
|
priority = 1000,
|
||||||
|
opts = {},
|
||||||
|
config = function()
|
||||||
|
require('catppuccin').setup {}
|
||||||
|
vim.cmd.colorscheme 'catppuccin-macchiato'
|
||||||
|
vim.o.cursorline = true
|
||||||
|
vim.wo.signcolumn = 'auto'
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
end,
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
-- nvim v0.8.0
|
||||||
|
return {
|
||||||
|
'kdheepak/lazygit.nvim',
|
||||||
|
lazy = true,
|
||||||
|
cmd = {
|
||||||
|
'LazyGit',
|
||||||
|
'LazyGitConfig',
|
||||||
|
'LazyGitCurrentFile',
|
||||||
|
'LazyGitFilter',
|
||||||
|
'LazyGitFilterCurrentFile',
|
||||||
|
},
|
||||||
|
-- optional for floating window border decoration
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
},
|
||||||
|
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||||
|
-- order to load the plugin when the command is run for the first time
|
||||||
|
keys = {
|
||||||
|
{ '<leader>lg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
|
||||||
|
},
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
-- For `plugins/markview.lua` users.
|
||||||
|
return {
|
||||||
|
'OXY2DEV/markview.nvim',
|
||||||
|
lazy = false,
|
||||||
|
|
||||||
|
-- For blink.cmp's completion
|
||||||
|
-- source
|
||||||
|
-- dependencies = {
|
||||||
|
-- "saghen/blink.cmp"
|
||||||
|
-- },
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
return {
|
||||||
|
'danymat/neogen',
|
||||||
|
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||||
|
config = true,
|
||||||
|
-- config = function ()
|
||||||
|
-- require('neogen').setup {
|
||||||
|
-- enabled = true,
|
||||||
|
-- }
|
||||||
|
-- vim.g.loaded_netrw = 1
|
||||||
|
-- vim.g.loaded_netrwPlugin = 1
|
||||||
|
-- end
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
return {
|
||||||
|
'nvim-neotest/neotest',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-neotest/nvim-nio',
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'antoinemadec/FixCursorHold.nvim',
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('neotest').setup {
|
||||||
|
adapters = {
|
||||||
|
require 'neotest-python' {
|
||||||
|
dap = { justMyCode = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
keys = { { '<leader>n', '<cmd>Neotest summary<CR>', desc = '[N]eotest Summary' } },
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
return {
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
version = '*',
|
||||||
|
lazy = false,
|
||||||
|
dependencies = {
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local HEIGHT_RATIO = 0.8
|
||||||
|
local WIDTH_RATIO = 0.5
|
||||||
|
require('nvim-tree').setup {
|
||||||
|
view = {
|
||||||
|
float = {
|
||||||
|
enable = true,
|
||||||
|
open_win_config = function()
|
||||||
|
local screen_w = vim.opt.columns:get()
|
||||||
|
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
|
||||||
|
local window_w = screen_w * WIDTH_RATIO
|
||||||
|
local window_h = screen_h * HEIGHT_RATIO
|
||||||
|
local window_w_int = math.floor(window_w)
|
||||||
|
local window_h_int = math.floor(window_h)
|
||||||
|
local center_x = (screen_w - window_w) / 2
|
||||||
|
local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
|
||||||
|
return {
|
||||||
|
border = 'rounded',
|
||||||
|
relative = 'editor',
|
||||||
|
row = center_y,
|
||||||
|
col = center_x,
|
||||||
|
width = window_w_int,
|
||||||
|
height = window_h_int,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
width = function()
|
||||||
|
return math.floor(vim.opt.columns:get() * WIDTH_RATIO)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
opts = function()
|
||||||
|
local mappings = { { '<leader>e', '<cmd>NvimTreeOpen<CR>', desc = 'File [E]xplorer' } }
|
||||||
|
require('which-key').add(mappings)
|
||||||
|
end,
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
return {
|
||||||
|
'michaelb/sniprun',
|
||||||
|
branch = 'master',
|
||||||
|
|
||||||
|
build = 'sh install.sh',
|
||||||
|
-- do 'sh install.sh 1' if you want to force compile locally
|
||||||
|
-- (instead of fetching a binary from the github release). Requires Rust >= 1.65
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
require('sniprun').setup {
|
||||||
|
-- your options
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
Loading…
Reference in New Issue