add nvim configs
This commit is contained in:
42
.config/nvim.backup/lua/plug_init/gitsigns.lua
Normal file
42
.config/nvim.backup/lua/plug_init/gitsigns.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = { text = '│' },
|
||||
change = { text = '│' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
follow_files = true
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
virt_text_priority = 100,
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
yadm = {
|
||||
enable = false
|
||||
},
|
||||
}
|
||||
10
.config/nvim.backup/lua/plug_init/init.lua
Normal file
10
.config/nvim.backup/lua/plug_init/init.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
require("plug_init.vim_init")
|
||||
require("plug_init.lazy_path")
|
||||
require("lazy").setup("plugins")
|
||||
require('onedark').load()
|
||||
|
||||
require("plug_init.wilder_init")
|
||||
require("plug_init.telescope_init")
|
||||
require("plugins.lsp_config")
|
||||
require("plug_init.lsp_init")
|
||||
require("plug_init.gitsigns")
|
||||
12
.config/nvim.backup/lua/plug_init/lazy_path.lua
Normal file
12
.config/nvim.backup/lua/plug_init/lazy_path.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
49
.config/nvim.backup/lua/plug_init/lsp_init.lua
Normal file
49
.config/nvim.backup/lua/plug_init/lsp_init.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
local lsp_zero = require('lsp-zero')
|
||||
------------
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
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'
|
||||
vim.keymap.set('n', 'öö', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', 'ää', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<leader>le', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', '<leader>K', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<leader>f', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
|
||||
-----------------
|
||||
lsp_zero.on_attach(function(client, bufnr)
|
||||
-- see :help lsp-zero-keybindings
|
||||
-- to learn the available actions
|
||||
lsp_zero.default_keymaps({buffer = bufnr})
|
||||
end)
|
||||
|
||||
require('lspconfig').rust_analyzer.setup{
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
imports = {
|
||||
granularity = {
|
||||
group = "module",
|
||||
},
|
||||
prefix = "self",
|
||||
},
|
||||
cargo = {
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
procMacro = {
|
||||
enable = true
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
10
.config/nvim.backup/lua/plug_init/nvim_possession_init.lua
Normal file
10
.config/nvim.backup/lua/plug_init/nvim_possession_init.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
require("nvim-possession").setup({
|
||||
autoload = false, -- default false
|
||||
autosave = true,
|
||||
autoswitch = {
|
||||
enable = true
|
||||
},
|
||||
sessions = {
|
||||
sessions_path = "/home/felix/.cache/nvim/sessions/"
|
||||
}
|
||||
})
|
||||
11
.config/nvim.backup/lua/plug_init/telescope_init.lua
Normal file
11
.config/nvim.backup/lua/plug_init/telescope_init.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
|
||||
vim.keymap.set('n', '<leader>gi', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>gd', builtin.git_status, {})
|
||||
|
||||
|
||||
|
||||
9
.config/nvim.backup/lua/plug_init/treestitter_init.lua
Normal file
9
.config/nvim.backup/lua/plug_init/treestitter_init.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
require("nvim-treesitter.configs").setup {
|
||||
ensure_installed = { "help", "lua", "rust", "typescript"},
|
||||
sync_install = false
|
||||
auto_install = true
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false
|
||||
}
|
||||
}
|
||||
37
.config/nvim.backup/lua/plug_init/vim_init.lua
Normal file
37
.config/nvim.backup/lua/plug_init/vim_init.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
vim.opt.compatible = false
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.incsearch = true
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.number = true
|
||||
vim.opt.wildmode = "longest,list"
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.ttyfast = true
|
||||
vim.opt.scrolloff = 5
|
||||
vim.opt.syntax = "on"
|
||||
vim.opt.wrap = false
|
||||
vim.opt.mouse = ""
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.undofile = true
|
||||
vim.opt.undodir = os.getenv("HOME").."/.local/share/nvim/undodir"
|
||||
vim.opt.updatetime = 50
|
||||
vim.opt.colorcolumn = "80"
|
||||
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- move highlighted lines up and down, automatic indentation
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- replace highlighted area without adding to register
|
||||
vim.keymap.set("x", "<leader>p", "\"_dP")
|
||||
|
||||
-- copy to system clipboard
|
||||
vim.keymap.set("n", "<leader>y", "\"+y")
|
||||
vim.keymap.set("v", "<leader>y", "\"+y")
|
||||
vim.keymap.set("n", "<leader>Y", "\"+Y")
|
||||
28
.config/nvim.backup/lua/plug_init/wilder_init.lua
Normal file
28
.config/nvim.backup/lua/plug_init/wilder_init.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
local wilder = require('wilder')
|
||||
local gradient = {
|
||||
'#f4468f', '#fd4a85', '#ff507a', '#ff566f', '#ff5e63',
|
||||
'#ff6658', '#ff704e', '#ff7a45', '#ff843d', '#ff9036',
|
||||
'#f89b31', '#efa72f', '#e6b32e', '#dcbe30', '#d2c934',
|
||||
'#c8d43a', '#bfde43', '#b6e84e', '#aff05b'
|
||||
}
|
||||
wilder.setup({modes = {':', '/', '?'} })
|
||||
wilder.set_option('pipeline', {
|
||||
wilder.branch(
|
||||
wilder.cmdline_pipeline(),
|
||||
wilder.search_pipeline()
|
||||
),
|
||||
})
|
||||
for i, fg in ipairs(gradient) do
|
||||
gradient[i] = wilder.make_hl('WilderGradient' .. i, 'Pmenu', {{a = 1}, {a = 1}, {foreground = fg}})
|
||||
end
|
||||
|
||||
wilder.set_option('renderer', wilder.wildmenu_renderer({
|
||||
highlights = {
|
||||
gradient = gradient, -- must be set
|
||||
-- selected_gradient key can be set to apply gradient highlighting for the selected candidate.
|
||||
},
|
||||
highlighter = wilder.highlighter_with_gradient({
|
||||
wilder.basic_highlighter(), -- or wilder.lua_fzy_highlighter(),
|
||||
}),
|
||||
}))
|
||||
Reference in New Issue
Block a user