Add config from linux conf
This commit is contained in:
parent
174d913f73
commit
6ba1596291
124 changed files with 3913 additions and 2 deletions
42
dot_config/nvim/lua/helpers.lua
Normal file
42
dot_config/nvim/lua/helpers.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd')
|
||||
local fn = vim.fn -- to call Vim functions e.g. fn.bufnr()
|
||||
local g = vim.g -- a table to access global variables
|
||||
local opt = vim.opt -- to set options
|
||||
local o = vim.o -- to set options
|
||||
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
local options = {noremap = true}
|
||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
local function dump(...)
|
||||
local objects = vim.tbl_map(vim.inspect, {...})
|
||||
print(unpack(objects))
|
||||
end
|
||||
|
||||
local function call_with_helpers(user_func)
|
||||
setfenv(user_func,
|
||||
vim.tbl_extend('force', getfenv(), get_helpers()))
|
||||
local status, err = pcall(user_func)
|
||||
if not status then
|
||||
print('Failure running setup function: ' .. vim.inspect(err))
|
||||
else
|
||||
return status
|
||||
end
|
||||
end
|
||||
|
||||
function get_helpers()
|
||||
return {
|
||||
map = map,
|
||||
cmd = cmd,
|
||||
fn = fn,
|
||||
g = g,
|
||||
opt = opt,
|
||||
o = o,
|
||||
dump = dump,
|
||||
call_with_helpers = call_with_helpers,
|
||||
}
|
||||
end
|
||||
|
||||
return get_helpers()
|
79
dot_config/nvim/lua/mappings.lua
Normal file
79
dot_config/nvim/lua/mappings.lua
Normal file
|
@ -0,0 +1,79 @@
|
|||
local function init()
|
||||
-- command! LogPath :lua print(vim.inspect(vim.lsp.get_log_path()))
|
||||
|
||||
-------------------- Telescope -----------------------------
|
||||
map('n', '<space>ff', '<cmd>Telescope find_files<CR>')
|
||||
map('n', '<space>fg', '<cmd>Telescope live_grep<CR>')
|
||||
map('n', '<space>fb', '<cmd>Telescope buffers<CR>')
|
||||
map('n', '<space>fh', '<cmd>Telescope help_tags<CR>')
|
||||
map('n', '<space>ps', [[<cmd>lua require('telescope.builtin').grep_string({ search = vim.fn.input("Grep For >")})<CR>]])
|
||||
|
||||
-------------------- NvimTreeToggle ------------------------
|
||||
map('n', '<space>tt', '<cmd>NvimTreeToggle<CR>')
|
||||
map('n', '<space>tr', '<cmd>NvimTreeRefresh<CR>')
|
||||
map('n', '<space>tf', '<cmd>NvimTreeFocus<CR>')
|
||||
|
||||
-------------------- Github Copilot ------------------------
|
||||
map('n', '<space>gd', '<cmd>Copilot disable<CR>')
|
||||
map('n', '<space>ge', '<cmd>Copilot enable<CR>')
|
||||
map('n', '<space>gi', '<cmd>Copilot setup<CR>')
|
||||
|
||||
-------------------- BarBar --------------------------------
|
||||
-- Move to previous/next
|
||||
map('n', '<A-,>', ':BufferPrevious<CR>', opts)
|
||||
map('n', '<A-.>', ':BufferNext<CR>', opts)
|
||||
-- Re-order to previous/next
|
||||
map('n', '<A-<>', ':BufferMovePrevious<CR>', opts)
|
||||
map('n', '<A->>', ':BufferMoveNext<CR>', opts)
|
||||
-- Close buffer
|
||||
map('n', '<A-c>', ':BufferClose<CR>', opts)
|
||||
|
||||
-------------------- LSP -----------------------------------
|
||||
map('n', '<space>,', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>')
|
||||
map('n', '<space>;', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>')
|
||||
map('n', '<space>a', '<cmd>lua vim.lsp.buf.code_action()<CR>')
|
||||
map('n', '<space>d', '<cmd>lua vim.lsp.buf.definition()<CR>')
|
||||
map('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>')
|
||||
map('n', '<space>h', '<cmd>lua vim.lsp.buf.hover()<CR>')
|
||||
map('n', '<space>m', '<cmd>lua vim.lsp.buf.rename()<CR>')
|
||||
map('n', '<space>r', '<cmd>lua vim.lsp.buf.references()<CR>')
|
||||
map('n', '<space>s', '<cmd>lua vim.lsp.buf.document_symbol()<CR>')
|
||||
map('n', '<leader>T', '<cmd>lua require\'lsp_extensions\'.inlay_hints()<CR>')
|
||||
|
||||
-------------------- HlsLens -------------------------------
|
||||
map('n', 'n', "<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>")
|
||||
map('n', 'N', "<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>")
|
||||
map('n', '*', "*<Cmd>lua require('hlslens').start()<CR>")
|
||||
map('n', '#', "#<Cmd>lua require('hlslens').start()<CR>")
|
||||
map('n', 'g*', "g*<Cmd>lua require('hlslens').start()<CR>")
|
||||
map('n', 'g#', "g#<Cmd>lua require('hlslens').start()<CR>")
|
||||
|
||||
-------------------- DAP -----------------------------------
|
||||
map('n', '<A-b>', '<cmd>lua require\'dap\'.toggle_breakpoint()<CR>', opts)
|
||||
map('n', '<A-v>', '<cmd>lua require\'dap\'.set_breakpoint(vim.fn.input(\'Breakpoint condition: \'))<CR>', opts)
|
||||
map('n', '<A-n>', '<cmd>lua require\'dap\'.continue()<CR>', opts)
|
||||
map('n', '<A-o>', '<cmd>lua require\'dap\'.repl.toggle()<CR>', opts)
|
||||
|
||||
-------------------- FTerm ---------------------------------
|
||||
map('n', '<F3>', '<CMD>lua require("FTerm").toggle()<CR>')
|
||||
map('t', '<F3>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>')
|
||||
|
||||
-------------------- LAZYGIT -------------------------------
|
||||
-- Install docs : https://github.com/jesseduffield/lazygit
|
||||
map('n', '<F2>', '<cmd>LazyGit<CR>')
|
||||
|
||||
-------------------- OTHER ---------------------------------
|
||||
map('i', '<Esc>', '<Esc>:w<CR>')
|
||||
map('n', '<Esc>', '<Esc>:w<CR>')
|
||||
|
||||
-------------------- COMMANDS ------------------------------
|
||||
cmd 'au TextYankPost * lua vim.highlight.on_yank {on_visual = false}' -- disabled in visual mode
|
||||
|
||||
-------------------- GITHUB COPILOT ------------------------
|
||||
map('i', '<C-j>', [[copilot#Accept("\<CR>")]], {noremap=true, silent=true, expr=true})
|
||||
cmd('let g:copilot_no_tab_map = v:true') -- Disable tab autocomplete github copilot
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
30
dot_config/nvim/lua/options.lua
Normal file
30
dot_config/nvim/lua/options.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
local function init()
|
||||
cmd('colorscheme moonlight')
|
||||
|
||||
opt.completeopt = {'menuone', 'noinsert', 'noselect'} -- Completion options (for deoplete)
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.hidden = true -- Enable background buffers
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.joinspaces = false -- No double spaces with join
|
||||
opt.list = true -- Show some invisible characters
|
||||
opt.number = true -- Show line numbers
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.scrolloff = 4 -- Lines of context
|
||||
opt.shiftround = true -- Round indent
|
||||
opt.shiftwidth = 2 -- Size of an indent
|
||||
opt.sidescrolloff = 8 -- Columns of context
|
||||
opt.smartcase = true -- Do not ignore case with capitals
|
||||
opt.autoindent = true -- Insert indents automatically
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.wildmode = {'list', 'longest'} -- Command-line completion mode
|
||||
opt.wrap = false -- Disable line wrap
|
||||
opt.mouse = 'a' -- Enable mouse for all previous modes
|
||||
o.clipboard = 'unnamedplus' -- Enabled clipboard shared yank
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
31
dot_config/nvim/lua/plugins/compe.lua
Normal file
31
dot_config/nvim/lua/plugins/compe.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
local function init()
|
||||
vim.o.completeopt = "menuone,noselect"
|
||||
require'compe'.setup {
|
||||
enabled = true;
|
||||
autocomplete = true;
|
||||
debug = false;
|
||||
min_length = 1;
|
||||
preselect = 'enable';
|
||||
throttle_time = 80;
|
||||
source_timeout = 200;
|
||||
incomplete_delay = 400;
|
||||
max_abbr_width = 100;
|
||||
max_kind_width = 100;
|
||||
max_menu_width = 100;
|
||||
documentation = true;
|
||||
|
||||
source = {
|
||||
path = true;
|
||||
buffer = true;
|
||||
calc = true;
|
||||
nvim_lsp = true;
|
||||
nvim_lua = true;
|
||||
vsnip = true;
|
||||
ultisnips = true;
|
||||
};
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/dap/init.lua
Normal file
7
dot_config/nvim/lua/plugins/dap/init.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
call_with_helpers(require('plugins.dap.lldb').init)
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
32
dot_config/nvim/lua/plugins/dap/lldb.lua
Normal file
32
dot_config/nvim/lua/plugins/dap/lldb.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
local dap = require('dap')
|
||||
|
||||
local function init()
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = '/usr/bin/lldb-vscode',
|
||||
name = 'lldb'
|
||||
}
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
runInTerminal = false,
|
||||
},
|
||||
}
|
||||
dap.configurations.c = dap.configurations.cpp
|
||||
-- dap.configurations.rust = dap.configurations.cpp
|
||||
-- dap.configurations.rust[1].program = function()
|
||||
-- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/target/debug/', 'file')
|
||||
-- end
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
150
dot_config/nvim/lua/plugins/init.lua
Normal file
150
dot_config/nvim/lua/plugins/init.lua
Normal file
|
@ -0,0 +1,150 @@
|
|||
function configure_packages()
|
||||
call_with_helpers(require('plugins.lspconfig').init)
|
||||
call_with_helpers(require('plugins.dap').init)
|
||||
call_with_helpers(require('plugins.compe').init)
|
||||
call_with_helpers(require('plugins.nvim-rust-tools').init)
|
||||
call_with_helpers(require('plugins.nvim-tree').init)
|
||||
call_with_helpers(require('plugins.nvim-treesitter').init)
|
||||
call_with_helpers(require('plugins.nvim-web-devicons').init)
|
||||
call_with_helpers(require('plugins.nvim-autopairs').init)
|
||||
call_with_helpers(require('plugins.nvim-notify').init)
|
||||
call_with_helpers(require('plugins.nvim-hlslens').init)
|
||||
call_with_helpers(require('plugins.nvim-flutter-tools').init)
|
||||
call_with_helpers(require('plugins.nvim-fterm').init)
|
||||
call_with_helpers(require('plugins.nvim-feline').init)
|
||||
call_with_helpers(require('plugins.nvim-todo-comments').init)
|
||||
call_with_helpers(require('plugins.nvim-lightspeed').init)
|
||||
call_with_helpers(require('plugins.nvim-numb').init)
|
||||
call_with_helpers(require('plugins.nvim-neoscroll').init)
|
||||
call_with_helpers(require('plugins.nvim-lspkind').init)
|
||||
call_with_helpers(require('plugins.nvim-signature').init)
|
||||
call_with_helpers(require('plugins.nvim-gutentags').init)
|
||||
call_with_helpers(require('plugins.nvim-indent-blankline').init)
|
||||
call_with_helpers(require('plugins.nvim-editorconfig').init)
|
||||
call_with_helpers(require('plugins.nvim-ctrlsf').init)
|
||||
end
|
||||
|
||||
function install_packages()
|
||||
-- Packer can manage itself as an optional plugin
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
-- LSP
|
||||
use 'neovim/nvim-lspconfig'
|
||||
use 'onsails/lspkind-nvim'
|
||||
use 'kabouzeid/nvim-lspinstall'
|
||||
use 'simrat39/rust-tools.nvim'
|
||||
|
||||
-- Autocomplete
|
||||
use 'hrsh7th/nvim-compe'
|
||||
use 'SirVer/ultisnips'
|
||||
use 'honza/vim-snippets'
|
||||
use 'windwp/nvim-autopairs'
|
||||
use 'AndrewRadev/tagalong.vim'
|
||||
use 'andymass/vim-matchup'
|
||||
|
||||
-- Treesitter
|
||||
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
|
||||
use 'p00f/nvim-ts-rainbow'
|
||||
use 'lukas-reineke/indent-blankline.nvim'
|
||||
use 'JoosepAlviste/nvim-ts-context-commentstring'
|
||||
use 'romgrk/nvim-treesitter-context'
|
||||
|
||||
-- Syntax
|
||||
use 'moll/vim-node'
|
||||
-- use 'zinit-zsh/zplugin-vim-syntax' -- NOT WORKING
|
||||
use 'editorconfig/editorconfig-vim'
|
||||
use 'chrisbra/csv.vim'
|
||||
use 'npxbr/glow.nvim'
|
||||
use 'junegunn/vim-easy-align'
|
||||
|
||||
-- Icons
|
||||
use 'kyazdani42/nvim-web-devicons'
|
||||
use 'ryanoasis/vim-devicons'
|
||||
|
||||
-- Status Line and Bufferline
|
||||
use 'famiu/feline.nvim' -- A minimal, stylish and customizable statusline for Neovim written in Lua
|
||||
use 'romgrk/barbar.nvim' -- Tabs, as understood by any other editor.
|
||||
|
||||
-- Telescope project search
|
||||
use 'nvim-lua/popup.nvim'
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use 'nvim-telescope/telescope.nvim'
|
||||
use 'nvim-telescope/telescope-fzy-native.nvim'
|
||||
use 'nvim-telescope/telescope-project.nvim'
|
||||
use 'fhill2/telescope-ultisnips.nvim'
|
||||
|
||||
-- Explorer
|
||||
use 'kyazdani42/nvim-tree.lua'
|
||||
|
||||
-- Git
|
||||
use 'kdheepak/lazygit.nvim'
|
||||
|
||||
-- Flutter
|
||||
use 'akinsho/flutter-tools.nvim'
|
||||
|
||||
-- Move & Search & replace
|
||||
use 'windwp/nvim-spectre'
|
||||
use 'nacro90/numb.nvim'
|
||||
use 'dyng/ctrlsf.vim'
|
||||
use 'kevinhwang91/nvim-hlslens' -- nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances.
|
||||
use 'ggandor/lightspeed.nvim'
|
||||
use 'kshenoy/vim-signature'
|
||||
use 'karb94/neoscroll.nvim'
|
||||
use 'dstein64/nvim-scrollview'
|
||||
use 'chaoren/vim-wordmotion'
|
||||
|
||||
-- Tim Pope docet
|
||||
use 'tpope/vim-sensible'
|
||||
use 'tpope/vim-rails'
|
||||
use 'tpope/vim-abolish'
|
||||
use 'tpope/vim-surround'
|
||||
use 'tpope/vim-bundler'
|
||||
use 'tpope/vim-capslock'
|
||||
use 'tpope/vim-repeat'
|
||||
use 'tpope/vim-endwise' -- auto complete block with end
|
||||
use 'tpope/vim-rvm'
|
||||
use 'tpope/vim-dispatch'
|
||||
use 'tpope/vim-dadbod'
|
||||
use 'tpope/vim-jdaddy'
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'tpope/vim-commentary'
|
||||
|
||||
-- Tmux
|
||||
use 'christoomey/vim-tmux-navigator'
|
||||
|
||||
-- Colorschema
|
||||
use 'dracula/vim'
|
||||
use 'whatyouhide/vim-gotham'
|
||||
use 'shaunsingh/moonlight.nvim'
|
||||
|
||||
-- Tags
|
||||
use 'ludovicchabant/vim-gutentags'
|
||||
|
||||
-- General Plugins
|
||||
use 'github/copilot.vim' -- Copilot is a vim plugin that helps you to create your own vim plugins.
|
||||
use 'rcarriga/nvim-notify' -- fancy notification
|
||||
use 'mfussenegger/nvim-dap' -- debugger
|
||||
use 'numtostr/FTerm.nvim' -- Floating terminal
|
||||
use 'folke/todo-comments.nvim'
|
||||
use 'lambdalisue/suda.vim'
|
||||
use 'mhinz/vim-startify' -- The fancy start screen for Vim.
|
||||
end
|
||||
|
||||
function init()
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim'
|
||||
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
cmd 'packadd packer.nvim'
|
||||
end
|
||||
|
||||
cmd 'packadd packer.nvim'
|
||||
|
||||
require('packer').startup(install_packages)
|
||||
|
||||
call_with_helpers(configure_packages)
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
11
dot_config/nvim/lua/plugins/lspconfig/init.lua
Normal file
11
dot_config/nvim/lua/plugins/lspconfig/init.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
local function init()
|
||||
call_with_helpers(require('plugins.lspconfig.lua').init)
|
||||
call_with_helpers(require('plugins.lspconfig.rust').init)
|
||||
call_with_helpers(require('plugins.lspconfig.typescript').init)
|
||||
call_with_helpers(require('plugins.lspconfig.ruby').init)
|
||||
call_with_helpers(require('plugins.lspconfig.php').init)
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
48
dot_config/nvim/lua/plugins/lspconfig/lua.lua
Normal file
48
dot_config/nvim/lua/plugins/lspconfig/lua.lua
Normal file
|
@ -0,0 +1,48 @@
|
|||
local function init()
|
||||
local system_name
|
||||
if vim.fn.has("mac") == 1 then
|
||||
system_name = "macOS"
|
||||
elseif vim.fn.has("unix") == 1 then
|
||||
system_name = "Linux"
|
||||
elseif vim.fn.has('win32') == 1 then
|
||||
system_name = "Windows"
|
||||
else
|
||||
print("Unsupported system for sumneko")
|
||||
end
|
||||
|
||||
local sumneko_root_path = fn.stdpath('cache')..'/lspconfig/sumneko_lua/lua-language-server'
|
||||
local sumneko_binary = sumneko_root_path.."/bin/"..system_name.."/lua-language-server"
|
||||
|
||||
require'lspconfig'.sumneko_lua.setup{
|
||||
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = vim.split(package.path, ';'),
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'},
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = {
|
||||
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
|
||||
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
|
||||
},
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/lspconfig/php.lua
Normal file
7
dot_config/nvim/lua/plugins/lspconfig/php.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
require'lspconfig'.phpactor.setup{}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/lspconfig/ruby.lua
Normal file
7
dot_config/nvim/lua/plugins/lspconfig/ruby.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
require'lspconfig'.sorbet.setup{}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/lspconfig/rust.lua
Normal file
7
dot_config/nvim/lua/plugins/lspconfig/rust.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
require'lspconfig'.rust_analyzer.setup{}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/lspconfig/typescript.lua
Normal file
7
dot_config/nvim/lua/plugins/lspconfig/typescript.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
require'lspconfig'.tsserver.setup{}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
11
dot_config/nvim/lua/plugins/nvim-autopairs.lua
Normal file
11
dot_config/nvim/lua/plugins/nvim-autopairs.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
local function init()
|
||||
require('nvim-autopairs').setup()
|
||||
require("nvim-autopairs.completion.compe").setup({
|
||||
map_cr = true, -- map <CR> on insert mode
|
||||
map_complete = true -- it will auto insert `(` after select function or method item
|
||||
})
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
9
dot_config/nvim/lua/plugins/nvim-ctrlsf.lua
Normal file
9
dot_config/nvim/lua/plugins/nvim-ctrlsf.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
local function init()
|
||||
g.ctrlsf_ackprg = 'rg'
|
||||
g.ctrls_auto_preview = 1
|
||||
g.ctrlsf_search_mode = 'async'
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/nvim-editorconfig.lua
Normal file
7
dot_config/nvim/lua/plugins/nvim-editorconfig.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
g.EditorConfig_exclude_patterns = { 'fugitive://.*', 'scp://.*' }
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/nvim-feline.lua
Normal file
7
dot_config/nvim/lua/plugins/nvim-feline.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
require('feline').setup()
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
15
dot_config/nvim/lua/plugins/nvim-flutter-tools.lua
Normal file
15
dot_config/nvim/lua/plugins/nvim-flutter-tools.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
local function init()
|
||||
require('flutter-tools').setup {
|
||||
decorations = {
|
||||
statusline = {
|
||||
app_version = true,
|
||||
device = true
|
||||
}
|
||||
},
|
||||
fvm = true
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
15
dot_config/nvim/lua/plugins/nvim-fterm.lua
Normal file
15
dot_config/nvim/lua/plugins/nvim-fterm.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
local function init()
|
||||
require'FTerm'.setup {
|
||||
border = 'double',
|
||||
dimensions = {
|
||||
height = 0.8,
|
||||
width = 0.8,
|
||||
x = 0.5,
|
||||
y = 0.5
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
17
dot_config/nvim/lua/plugins/nvim-gutentags.lua
Normal file
17
dot_config/nvim/lua/plugins/nvim-gutentags.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
local function init()
|
||||
cmd('set tags+=tags,.git/tags')
|
||||
g.gutentags_enabled = 1
|
||||
g.gutentags_generate_on_missing = 1
|
||||
g.gutentags_generate_on_write = 1
|
||||
g.gutentags_resolve_symlinks = 1
|
||||
g.gutentags_ctags_tagfile = '.git/tags'
|
||||
g.gutentags_project_root = { '.git' }
|
||||
g.gutentags_ctags_extra_args = { '--fields=+l' }
|
||||
g.gutentags_add_default_project_roots = 0
|
||||
g.gutentags_ctags_executable_ruby = 'ripper-tags'
|
||||
g.gutentags_ctags_extra_args = { '--ignore-unsupported-options', '--recursive' }
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
36
dot_config/nvim/lua/plugins/nvim-hlslens.lua
Normal file
36
dot_config/nvim/lua/plugins/nvim-hlslens.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
local function init()
|
||||
require('hlslens').setup {
|
||||
calm_down = true,
|
||||
override_lens = function(render, plist, nearest, idx, r_idx)
|
||||
local sfw = vim.v.searchforward == 1
|
||||
local indicator, text, chunks
|
||||
local abs_r_idx = math.abs(r_idx)
|
||||
if abs_r_idx > 1 then
|
||||
indicator = string.format('%d%s', abs_r_idx, sfw ~= (r_idx > 1) and '' or '')
|
||||
elseif abs_r_idx == 1 then
|
||||
indicator = sfw ~= (r_idx == 1) and '' or ''
|
||||
else
|
||||
indicator = ''
|
||||
end
|
||||
|
||||
local lnum, col = unpack(plist[idx])
|
||||
if nearest then
|
||||
local cnt = #plist
|
||||
if indicator ~= '' then
|
||||
text = string.format('[%s %d/%d]', indicator, idx, cnt)
|
||||
else
|
||||
text = string.format('[%d/%d]', idx, cnt)
|
||||
end
|
||||
chunks = {{' ', 'Ignore'}, {text, 'HlSearchLensNear'}}
|
||||
else
|
||||
text = string.format('[%s %d]', indicator, idx)
|
||||
chunks = {{' ', 'Ignore'}, {text, 'HlSearchLens'}}
|
||||
end
|
||||
render.set_virt(0, lnum - 1, col - 1, chunks, nearest)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
12
dot_config/nvim/lua/plugins/nvim-indent-blankline.lua
Normal file
12
dot_config/nvim/lua/plugins/nvim-indent-blankline.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
local function init()
|
||||
g.indent_blankline_show_current_context = true
|
||||
g.indent_blankline_buftype_exclude = {'terminal'}
|
||||
g.indent_blankline_filetype_exclude = {'help', 'startify', 'dashboard', 'packer', 'neogitstatus', 'NvimTree'}
|
||||
g.indent_blankline_char = '▏'
|
||||
g.indent_blankline_use_treesitter = true
|
||||
g.indent_blankline_show_trailing_blankline_indent = false
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/nvim-lightspeed.lua
Normal file
7
dot_config/nvim/lua/plugins/nvim-lightspeed.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
require("lightspeed").setup {}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
9
dot_config/nvim/lua/plugins/nvim-lspkind.lua
Normal file
9
dot_config/nvim/lua/plugins/nvim-lspkind.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
local function init()
|
||||
require('lspkind').init {
|
||||
with_text = true,
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/nvim-neoscroll.lua
Normal file
7
dot_config/nvim/lua/plugins/nvim-neoscroll.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
require('neoscroll').setup()
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/nvim-notify.lua
Normal file
7
dot_config/nvim/lua/plugins/nvim-notify.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
vim.notify = require("notify")
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
10
dot_config/nvim/lua/plugins/nvim-numb.lua
Normal file
10
dot_config/nvim/lua/plugins/nvim-numb.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
local function init()
|
||||
require('numb').setup {
|
||||
show_numbers = true, -- Enable 'number' for the window while peeking
|
||||
show_cursorline = true -- Enable 'cursorline' for the window while peeking
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
119
dot_config/nvim/lua/plugins/nvim-rust-tools.lua
Normal file
119
dot_config/nvim/lua/plugins/nvim-rust-tools.lua
Normal file
|
@ -0,0 +1,119 @@
|
|||
local opts = {
|
||||
tools = { -- rust-tools options
|
||||
-- Automatically set inlay hints (type hints)
|
||||
autoSetHints = true,
|
||||
|
||||
-- Whether to show hover actions inside the hover window
|
||||
-- This overrides the default hover handler
|
||||
hover_with_actions = true,
|
||||
|
||||
-- how to execute terminal commands
|
||||
-- options right now: termopen / quickfix
|
||||
executor = require("rust-tools/executors").termopen,
|
||||
|
||||
runnables = {
|
||||
-- whether to use telescope for selection menu or not
|
||||
use_telescope = true
|
||||
|
||||
-- rest of the opts are forwarded to telescope
|
||||
},
|
||||
|
||||
debuggables = {
|
||||
-- whether to use telescope for selection menu or not
|
||||
use_telescope = true
|
||||
|
||||
-- rest of the opts are forwarded to telescope
|
||||
},
|
||||
|
||||
-- These apply to the default RustSetInlayHints command
|
||||
inlay_hints = {
|
||||
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = false,
|
||||
|
||||
-- Event which triggers a refersh of the inlay hints.
|
||||
-- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but
|
||||
-- not that this may cause higher CPU usage.
|
||||
-- This option is only respected when only_current_line and
|
||||
-- autoSetHints both are true.
|
||||
only_current_line_autocmd = "CursorHold",
|
||||
|
||||
-- wheter to show parameter hints with the inlay hints or not
|
||||
show_parameter_hints = true,
|
||||
|
||||
-- prefix for parameter hints
|
||||
parameter_hints_prefix = "<- ",
|
||||
|
||||
-- prefix for all the other hints (type, chaining)
|
||||
other_hints_prefix = "=> ",
|
||||
|
||||
-- whether to align to the length of the longest line in the file
|
||||
max_len_align = false,
|
||||
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
|
||||
-- The color of the hints
|
||||
highlight = "Comment",
|
||||
},
|
||||
|
||||
hover_actions = {
|
||||
-- the border that is used for the hover window
|
||||
-- see vim.api.nvim_open_win()
|
||||
border = {
|
||||
{"╭", "FloatBorder"}, {"─", "FloatBorder"},
|
||||
{"╮", "FloatBorder"}, {"│", "FloatBorder"},
|
||||
{"╯", "FloatBorder"}, {"─", "FloatBorder"},
|
||||
{"╰", "FloatBorder"}, {"│", "FloatBorder"}
|
||||
},
|
||||
|
||||
-- whether the hover action window gets automatically focused
|
||||
auto_focus = false
|
||||
},
|
||||
|
||||
-- settings for showing the crate graph based on graphviz and the dot
|
||||
-- command
|
||||
crate_graph = {
|
||||
-- Backend used for displaying the graph
|
||||
-- see: https://graphviz.org/docs/outputs/
|
||||
-- default: x11
|
||||
backend = "x11",
|
||||
-- where to store the output, nil for no output stored (relative
|
||||
-- path from pwd)
|
||||
-- default: nil
|
||||
output = nil,
|
||||
-- true for all crates.io and external crates, false only the local
|
||||
-- crates
|
||||
-- default: true
|
||||
full = true,
|
||||
}
|
||||
},
|
||||
|
||||
-- all the opts to send to nvim-lspconfig
|
||||
-- these override the defaults set by rust-tools.nvim
|
||||
-- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
|
||||
server = {}, -- rust-analyer options
|
||||
|
||||
-- debugging stuff
|
||||
dap = {
|
||||
adapter = {
|
||||
type = 'executable',
|
||||
command = 'lldb-vscode',
|
||||
name = "rt_lldb"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local function init()
|
||||
require('rust-tools').setup(opts)
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
8
dot_config/nvim/lua/plugins/nvim-signature.lua
Normal file
8
dot_config/nvim/lua/plugins/nvim-signature.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
local function init()
|
||||
g.SignatureMarkTextHLDynamic = 1
|
||||
g.SignatureMarkerTextHLDynamic = 1
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
61
dot_config/nvim/lua/plugins/nvim-todo-comments.lua
Normal file
61
dot_config/nvim/lua/plugins/nvim-todo-comments.lua
Normal file
|
@ -0,0 +1,61 @@
|
|||
local function init()
|
||||
require("todo-comments").setup {
|
||||
signs = true, -- show icons in the signs column
|
||||
sign_priority = 8, -- sign priority
|
||||
-- keywords recognized as todo comments
|
||||
keywords = {
|
||||
FIX = {
|
||||
icon = " ", -- icon used for the sign, and in search results
|
||||
color = "error", -- can be a hex color, or a named color (see below)
|
||||
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
|
||||
-- signs = false, -- configure signs for some keywords individually
|
||||
},
|
||||
TODO = { icon = " ", color = "info" },
|
||||
HACK = { icon = " ", color = "warning" },
|
||||
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
||||
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
||||
},
|
||||
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
||||
-- highlighting of the line containing the todo comment
|
||||
-- * before: highlights before the keyword (typically comment characters)
|
||||
-- * keyword: highlights of the keyword
|
||||
-- * after: highlights after the keyword (todo text)
|
||||
highlight = {
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex)
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
-- list of named colors where we try to extract the guifg from the
|
||||
-- list of hilight groups or use the hex color if hl not found as a fallback
|
||||
colors = {
|
||||
error = { "LspDiagnosticsDefaultError", "ErrorMsg", "#DC2626" },
|
||||
warning = { "LspDiagnosticsDefaultWarning", "WarningMsg", "#FBBF24" },
|
||||
info = { "LspDiagnosticsDefaultInformation", "#2563EB" },
|
||||
hint = { "LspDiagnosticsDefaultHint", "#10B981" },
|
||||
default = { "Identifier", "#7C3AED" },
|
||||
},
|
||||
search = {
|
||||
command = "rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
-- regex that will be used to match keywords.
|
||||
-- don't replace the (KEYWORDS) placeholder
|
||||
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
|
||||
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
7
dot_config/nvim/lua/plugins/nvim-tree.lua
Normal file
7
dot_config/nvim/lua/plugins/nvim-tree.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local function init()
|
||||
require'nvim-tree'.setup {}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
16
dot_config/nvim/lua/plugins/nvim-treesitter.lua
Normal file
16
dot_config/nvim/lua/plugins/nvim-treesitter.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
local function init()
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = "all", -- list of languages
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
12
dot_config/nvim/lua/plugins/nvim-web-devicons.lua
Normal file
12
dot_config/nvim/lua/plugins/nvim-web-devicons.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
local function init()
|
||||
require'nvim-web-devicons'.setup {
|
||||
-- globally enable default icons (default to false)
|
||||
-- will get overriden by `get_icons` option
|
||||
default = true;
|
||||
}
|
||||
require'nvim-web-devicons'.get_icons()
|
||||
end
|
||||
|
||||
return {
|
||||
init = init
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue