First draft at going back to nvim
This commit is contained in:
parent
b8b20cf817
commit
37afe78942
9 changed files with 82 additions and 169 deletions
|
@ -38,7 +38,7 @@ gtk3 = { source = "gtk/gtk-3.0", target = ".config/gtk-3.0" }
|
||||||
hypr = { source = "hypr", target = ".config/hypr" }
|
hypr = { source = "hypr", target = ".config/hypr" }
|
||||||
kitty = { source = "kitty", target = ".config/kitty" }
|
kitty = { source = "kitty", target = ".config/kitty" }
|
||||||
lsd = { source = "lsd", target = ".config/lsd" }
|
lsd = { source = "lsd", target = ".config/lsd" }
|
||||||
lvim = { source = "lvim/config.lua", target = ".config/lvim/config.lua" }
|
nvim = { source = "nvim", target = ".config/nvim" }
|
||||||
rofi = { source = "rofi", target = ".config/rofi" }
|
rofi = { source = "rofi", target = ".config/rofi" }
|
||||||
steam = { source = "steam/steam_dev.cfg", target = ".steam/steam/steam_dev.cfg" }
|
steam = { source = "steam/steam_dev.cfg", target = ".steam/steam/steam_dev.cfg" }
|
||||||
swaylock = { source = "swaylock", target = ".config/swaylock" }
|
swaylock = { source = "swaylock", target = ".config/swaylock" }
|
||||||
|
|
161
lvim/config.lua
161
lvim/config.lua
|
@ -1,161 +0,0 @@
|
||||||
--[[
|
|
||||||
THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
|
|
||||||
`lvim` is the global options object
|
|
||||||
]]
|
|
||||||
|
|
||||||
lvim.transparent_window = true
|
|
||||||
lvim.plugins = {
|
|
||||||
{ "catppuccin/nvim" },
|
|
||||||
{ "gpanders/editorconfig.nvim" },
|
|
||||||
{
|
|
||||||
"windwp/nvim-ts-autotag",
|
|
||||||
config = function()
|
|
||||||
require("nvim-ts-autotag").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{ "mrjones2014/nvim-ts-rainbow" },
|
|
||||||
{
|
|
||||||
"romgrk/nvim-treesitter-context",
|
|
||||||
config = function()
|
|
||||||
require("treesitter-context").setup {
|
|
||||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
|
||||||
throttle = true, -- Throttles plugin updates (may improve performance)
|
|
||||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
|
||||||
patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
|
|
||||||
-- For all filetypes
|
|
||||||
-- Note that setting an entry here replaces all other patterns for this entry.
|
|
||||||
-- By setting the 'default' entry below, you can control which nodes you want to
|
|
||||||
-- appear in the context window.
|
|
||||||
default = {
|
|
||||||
'class',
|
|
||||||
'function',
|
|
||||||
'method',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ray-x/lsp_signature.nvim",
|
|
||||||
event = "BufRead",
|
|
||||||
config = function() require "lsp_signature".on_attach() end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"folke/todo-comments.nvim",
|
|
||||||
event = "BufRead",
|
|
||||||
config = function()
|
|
||||||
require("todo-comments").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{ "f-person/git-blame.nvim" },
|
|
||||||
}
|
|
||||||
|
|
||||||
-- vim options
|
|
||||||
--vim.opt.shiftwidth = 2
|
|
||||||
--vim.opt.tabstop = 2
|
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.clipboard = "unnamedplus"
|
|
||||||
vim.opt.wrap = true
|
|
||||||
vim.opt.spell = true
|
|
||||||
vim.opt.spelllang = "en"
|
|
||||||
|
|
||||||
-- general
|
|
||||||
lvim.log.level = "info"
|
|
||||||
lvim.format_on_save = {
|
|
||||||
enabled = true,
|
|
||||||
pattern = "*.lua",
|
|
||||||
timeout = 1000,
|
|
||||||
}
|
|
||||||
-- to disable icons and use a minimalist setup, uncomment the following
|
|
||||||
-- lvim.use_icons = false
|
|
||||||
|
|
||||||
-- keymappings <https://www.lunarvim.org/docs/configuration/keybindings>
|
|
||||||
lvim.leader = "space"
|
|
||||||
-- add your own keymapping
|
|
||||||
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
|
||||||
|
|
||||||
-- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
|
|
||||||
-- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
|
|
||||||
|
|
||||||
-- -- Use which-key to add extra bindings with the leader-key prefix
|
|
||||||
-- lvim.builtin.which_key.mappings["W"] = { "<cmd>noautocmd w<cr>", "Save without formatting" }
|
|
||||||
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
|
|
||||||
|
|
||||||
-- -- Change theme settings
|
|
||||||
-- lvim.colorscheme = "lunar"
|
|
||||||
|
|
||||||
-- After changing plugin config exit and reopen LunarVim, Run :PackerSync
|
|
||||||
lvim.builtin.alpha.active = true
|
|
||||||
lvim.builtin.alpha.mode = "dashboard"
|
|
||||||
lvim.builtin.terminal.active = true
|
|
||||||
lvim.builtin.nvimtree.setup.view.side = "left"
|
|
||||||
lvim.builtin.nvimtree.setup.renderer.icons.show.git = true
|
|
||||||
|
|
||||||
-- Automatically install missing parsers when entering buffer
|
|
||||||
lvim.builtin.treesitter.auto_install = true
|
|
||||||
lvim.builtin.treesitter.rainbow.enable = true
|
|
||||||
|
|
||||||
-- lvim.builtin.treesitter.ignore_install = { "haskell" }
|
|
||||||
|
|
||||||
-- -- generic LSP settings <https://www.lunarvim.org/docs/languages#lsp-support>
|
|
||||||
|
|
||||||
-- --- disable automatic installation of servers
|
|
||||||
-- lvim.lsp.installer.setup.automatic_installation = false
|
|
||||||
|
|
||||||
-- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect
|
|
||||||
-- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers`
|
|
||||||
-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
|
|
||||||
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
|
|
||||||
-- require("lvim.lsp.manager").setup("pyright", opts)
|
|
||||||
|
|
||||||
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect
|
|
||||||
-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
|
|
||||||
-- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
|
|
||||||
-- return server ~= "emmet_ls"
|
|
||||||
-- end, lvim.lsp.automatic_configuration.skipped_servers)
|
|
||||||
|
|
||||||
-- -- you can set a custom on_attach function that will be used for all the language servers
|
|
||||||
-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
|
|
||||||
-- lvim.lsp.on_attach_callback = function(client, bufnr)
|
|
||||||
-- local function buf_set_option(...)
|
|
||||||
-- vim.api.nvim_buf_set_option(bufnr, ...)
|
|
||||||
-- end
|
|
||||||
-- --Enable completion triggered by <c-x><c-o>
|
|
||||||
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- -- linters and formatters <https://www.lunarvim.org/docs/languages#lintingformatting>
|
|
||||||
-- local formatters = require "lvim.lsp.null-ls.formatters"
|
|
||||||
-- formatters.setup {
|
|
||||||
-- { command = "stylua" },
|
|
||||||
-- {
|
|
||||||
-- command = "prettier",
|
|
||||||
-- extra_args = { "--print-width", "100" },
|
|
||||||
-- filetypes = { "typescript", "typescriptreact" },
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
-- local linters = require "lvim.lsp.null-ls.linters"
|
|
||||||
-- linters.setup {
|
|
||||||
-- { command = "flake8", filetypes = { "python" } },
|
|
||||||
-- {
|
|
||||||
-- command = "shellcheck",
|
|
||||||
-- args = { "--severity", "warning" },
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- -- Additional Plugins <https://www.lunarvim.org/docs/plugins#user-plugins>
|
|
||||||
-- lvim.plugins = {
|
|
||||||
-- {
|
|
||||||
-- "folke/trouble.nvim",
|
|
||||||
-- cmd = "TroubleToggle",
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html>
|
|
||||||
-- vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
-- pattern = "zsh",
|
|
||||||
-- callback = function()
|
|
||||||
-- -- let treesitter use bash highlight for zsh files as well
|
|
||||||
-- require("nvim-treesitter.highlight").attach(0, "bash")
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
2
nvim/init.lua
Normal file
2
nvim/init.lua
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
require("config.vimopts")
|
||||||
|
require("config.lazy")
|
37
nvim/lua/config/lazy.lua
Normal file
37
nvim/lua/config/lazy.lua
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
-- Modified from https://lazy.folke.io/installation
|
||||||
|
|
||||||
|
-- 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 = "\\"
|
||||||
|
|
||||||
|
-- Setup lazy.nvim
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- 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 = { "habamax" } },
|
||||||
|
-- automatically check for plugin updates
|
||||||
|
checker = { enabled = true },
|
||||||
|
})
|
7
nvim/lua/config/vimopts.lua
Normal file
7
nvim/lua/config/vimopts.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.clipboard = "unnamedplus"
|
||||||
|
vim.opt.wrap = true
|
||||||
|
vim.opt.spell = true
|
||||||
|
vim.opt.spelllang = "en"
|
32
nvim/lua/plugins.lua
Normal file
32
nvim/lua/plugins.lua
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
return {
|
||||||
|
"gpanders/editorconfig.nvim",
|
||||||
|
"mhartington/formatter.nvim",
|
||||||
|
"f-person/git-blame.nvim",
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
config = function()
|
||||||
|
require("mason").setup()
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require("catppuccin").setup({
|
||||||
|
flavour = "mocha",
|
||||||
|
transparent_background = true,
|
||||||
|
})
|
||||||
|
vim.cmd.colorscheme "catppuccin"
|
||||||
|
end
|
||||||
|
},
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
|
{
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" }
|
||||||
|
},
|
||||||
|
}
|
|
@ -13,7 +13,6 @@ export RECOLL_CONFDIR="$XDG_CONFIG_HOME/recoll"
|
||||||
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
||||||
export ZSH="$XDG_DATA_HOME/oh-my-zsh"
|
export ZSH="$XDG_DATA_HOME/oh-my-zsh"
|
||||||
export RANDFILE="$XDG_CACHE_HOME/.rnd"
|
export RANDFILE="$XDG_CACHE_HOME/.rnd"
|
||||||
export VIMINIT='let $MYVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/vimrc" : "$XDG_CONFIG_HOME/nvim/init.vim" | so $MYVIMRC'
|
|
||||||
alias wget='wget --hsts-file="$XDG_DATA_HOME/wget-hsts"'
|
alias wget='wget --hsts-file="$XDG_DATA_HOME/wget-hsts"'
|
||||||
export W3M_DIR="$XDG_DATA_HOME/w3m"
|
export W3M_DIR="$XDG_DATA_HOME/w3m"
|
||||||
export NUGET_PACKAGES="$XDG_CACHE_HOME/NuGetPackages"
|
export NUGET_PACKAGES="$XDG_CACHE_HOME/NuGetPackages"
|
||||||
|
|
|
@ -15,10 +15,8 @@ set viewdir=$XDG_STATE_HOME/vim/view | call mkdir(&viewdir, 'p')
|
||||||
|
|
||||||
if !has('nvim') | set viminfofile=$XDG_STATE_HOME/vim/viminfo | endif
|
if !has('nvim') | set viminfofile=$XDG_STATE_HOME/vim/viminfo | endif
|
||||||
|
|
||||||
set number
|
set relativenumber
|
||||||
set nocompatible
|
|
||||||
filetype on
|
filetype on
|
||||||
syntax on
|
syntax on
|
||||||
set cursorline
|
set shiftwidth=4
|
||||||
set cursorcolumn
|
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
|
|
|
@ -97,11 +97,10 @@ help() {
|
||||||
"$@" --help 2>&1 | bat --plain --language=help
|
"$@" --help 2>&1 | bat --plain --language=help
|
||||||
}
|
}
|
||||||
|
|
||||||
alias n="nvim"
|
|
||||||
if [[ "$TERM" == "linux" ]] ; then
|
if [[ "$TERM" == "linux" ]] ; then
|
||||||
export EDITOR="vim"
|
export EDITOR="vim"
|
||||||
else
|
else
|
||||||
export EDITOR="lvim"
|
export EDITOR="nvim"
|
||||||
fi
|
fi
|
||||||
alias v="$EDITOR"
|
alias v="$EDITOR"
|
||||||
alias sv="sudo vim"
|
alias sv="sudo vim"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue