mirror of
https://codeberg.org/diginaut/dotfiles.git
synced 2026-02-04 07:40:27 +01:00
Merge pull request 'neovim' (#3) from neovim into master
Reviewed-on: https://codeberg.org/diginaut/dotfiles/pulls/3
This commit is contained in:
1
.config/nvim/init.lua
Normal file
1
.config/nvim/init.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
require("config.lazy")
|
||||||
49
.config/nvim/lua/config/lazy.lua
Normal file
49
.config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
-- Bootstrap lazy.nvim
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
|
if vim.v.shell_error ~= 0 then
|
||||||
|
vim.api.nvim_echo({
|
||||||
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
{ out, "WarningMsg" },
|
||||||
|
{ "\nPress any key to exit..." },
|
||||||
|
}, true, {})
|
||||||
|
vim.fn.getchar()
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||||
|
-- loading lazy.nvim so that mappings are correct.
|
||||||
|
-- This is also a good place to setup other settings (vim.opt)
|
||||||
|
vim.g.mapleader = ","
|
||||||
|
vim.g.maplocalleader = ","
|
||||||
|
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = false -- relative line numbers
|
||||||
|
vim.opt.tabstop = 4 -- tab width
|
||||||
|
vim.opt.shiftwidth = 4 -- indent width
|
||||||
|
vim.opt.expandtab = true -- spaces instead of tabs
|
||||||
|
vim.opt.smartindent = true -- smart indentation
|
||||||
|
vim.opt.termguicolors = true -- true color support
|
||||||
|
vim.opt.clipboard = "unnamedplus" -- system clipboard
|
||||||
|
|
||||||
|
-- vim.cmd.colorscheme 'kanagawa-dragon'
|
||||||
|
vim.opt.smoothscroll = true
|
||||||
|
|
||||||
|
-- Setup lazy.nvim
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- add LazyVim and import its plugins
|
||||||
|
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||||
|
-- import your plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
|
-- colorscheme that will be used when installing plugins.
|
||||||
|
install = { colorscheme = { "kanagawa-dragon" } },
|
||||||
|
-- automatically check for plugin updates
|
||||||
|
checker = { enabled = true },
|
||||||
|
})
|
||||||
3
.config/nvim/lua/plugins/colorizer.lua
Normal file
3
.config/nvim/lua/plugins/colorizer.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
'norcalli/nvim-colorizer.lua'
|
||||||
|
};
|
||||||
9
.config/nvim/lua/plugins/colorscheme.lua
Normal file
9
.config/nvim/lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
'folke/tokyonight.nvim',
|
||||||
|
'rebelot/kanagawa.nvim',
|
||||||
|
'Shatur/neovim-ayu',
|
||||||
|
config = function()
|
||||||
|
-- load the colorscheme
|
||||||
|
vim.cmd([[colorscheme kanagawa-dragon]])
|
||||||
|
end,
|
||||||
|
}
|
||||||
16
.config/nvim/lua/plugins/python.lua
Normal file
16
.config/nvim/lua/plugins/python.lua
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
return {
|
||||||
|
"linux-cultist/venv-selector.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
},
|
||||||
|
ft = "python", -- Load when opening Python files
|
||||||
|
opts = {
|
||||||
|
search = {}, -- if you add your own searches, they go here.
|
||||||
|
options = {} -- if you add plugin options, they go here.
|
||||||
|
},
|
||||||
|
event = 'VeryLazy', -- Optional: needed only if you want to type `:VenvSelect` without a keymapping
|
||||||
|
keys = {
|
||||||
|
{ "<leader>V", "<cmd>VenvSelect<cr>" }, -- Open picker on keymap
|
||||||
|
},
|
||||||
|
}
|
||||||
80
.config/nvim/lua/plugins/treesitter.lua
Normal file
80
.config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
|
||||||
|
dependencies = {
|
||||||
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||||
|
'nvim-treesitter/nvim-treesitter-refactor',
|
||||||
|
},
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {},
|
||||||
|
sync_install = 'false',
|
||||||
|
auto_install = 'true',
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
init_selection = "gnn",
|
||||||
|
node_incremental = "grn",
|
||||||
|
scope_incremental = "grc",
|
||||||
|
node_decremental = "grm",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
indent = { enable = true },
|
||||||
|
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true,
|
||||||
|
|
||||||
|
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" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
swap = {
|
||||||
|
enable = true,
|
||||||
|
swap_previous = { ["[."] = "@parameter.inner", },
|
||||||
|
swap_next = { ["]."] = "@parameter.inner", },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
refactor = {
|
||||||
|
highlight_definitions = {
|
||||||
|
enable = true,
|
||||||
|
-- Set to false if you have an `updatetime` of ~100.
|
||||||
|
clear_on_cursor_move = true,
|
||||||
|
},
|
||||||
|
highlight_current_scope = { enable = false },
|
||||||
|
smart_rename = {
|
||||||
|
enable = true,
|
||||||
|
-- Assign keymaps to false to disable them, e.g. `smart_rename = false`.
|
||||||
|
keymaps = {
|
||||||
|
smart_rename = "grr",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||||
|
'nvim-treesitter/nvim-treesitter-refactor',
|
||||||
|
}
|
||||||
@@ -66,7 +66,7 @@ cd || exit
|
|||||||
mkdir -p .config/direnv
|
mkdir -p .config/direnv
|
||||||
|
|
||||||
# Symlink all the things
|
# Symlink all the things
|
||||||
for TARGET in .bash_aliases .bashrc bin .gitconfig .gitignore_global .gitmodules .hgauthors.txt .hgignore .hgrc .ideavimrc .ignore .screenrc .terminfo .tmux.conf .vim .vimrc install.sh .config/direnv/direnvrc
|
for TARGET in .bash_aliases .bashrc bin .gitconfig .gitignore_global .gitmodules .hgauthors.txt .hgignore .hgrc .ideavimrc .ignore .screenrc .terminfo .tmux.conf .vim .vimrc install.sh .config/direnv/direnvrc .config/nvim
|
||||||
do
|
do
|
||||||
make_link $DIR $TARGET
|
make_link $DIR $TARGET
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user