1
0
Fork 0

Add config from linux conf

This commit is contained in:
Florian RICHER (MrDev023) 2022-04-13 21:54:22 +02:00
parent 174d913f73
commit 6ba1596291
124 changed files with 3913 additions and 2 deletions

View 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
}

View file

@ -0,0 +1,7 @@
local function init()
call_with_helpers(require('plugins.dap.lldb').init)
end
return {
init = init
}

View 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
}

View 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
}

View 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
}

View 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
}

View file

@ -0,0 +1,7 @@
local function init()
require'lspconfig'.phpactor.setup{}
end
return {
init = init
}

View file

@ -0,0 +1,7 @@
local function init()
require'lspconfig'.sorbet.setup{}
end
return {
init = init
}

View file

@ -0,0 +1,7 @@
local function init()
require'lspconfig'.rust_analyzer.setup{}
end
return {
init = init
}

View file

@ -0,0 +1,7 @@
local function init()
require'lspconfig'.tsserver.setup{}
end
return {
init = init
}

View 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
}

View 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
}

View file

@ -0,0 +1,7 @@
local function init()
g.EditorConfig_exclude_patterns = { 'fugitive://.*', 'scp://.*' }
end
return {
init = init
}

View file

@ -0,0 +1,7 @@
local function init()
require('feline').setup()
end
return {
init = init
}

View 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
}

View 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
}

View 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
}

View 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
}

View 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
}

View file

@ -0,0 +1,7 @@
local function init()
require("lightspeed").setup {}
end
return {
init = init
}

View file

@ -0,0 +1,9 @@
local function init()
require('lspkind').init {
with_text = true,
}
end
return {
init = init
}

View file

@ -0,0 +1,7 @@
local function init()
require('neoscroll').setup()
end
return {
init = init
}

View file

@ -0,0 +1,7 @@
local function init()
vim.notify = require("notify")
end
return {
init = init
}

View 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
}

View 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
}

View file

@ -0,0 +1,8 @@
local function init()
g.SignatureMarkTextHLDynamic = 1
g.SignatureMarkerTextHLDynamic = 1
end
return {
init = init
}

View 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
}

View file

@ -0,0 +1,7 @@
local function init()
require'nvim-tree'.setup {}
end
return {
init = init
}

View 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
}

View 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
}