no vim-plug
i guess that doesn't work
This commit is contained in:
parent
8de21f2484
commit
24d10101a9
19 changed files with 143 additions and 374 deletions
|
|
@ -47,7 +47,6 @@
|
|||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
vim
|
||||
# Nix
|
||||
nh
|
||||
alejandra
|
||||
|
|
|
|||
25
users/coyote/dotfiles.nix
Normal file
25
users/coyote/dotfiles.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
mkVim = src: langs:
|
||||
builtins.listToAttrs (map (lang: {
|
||||
name = ".vim/after/ftplugin/${lang}.vim";
|
||||
value = {source = src;};
|
||||
})
|
||||
langs);
|
||||
in {
|
||||
home.file = lib.mkMerge [
|
||||
{
|
||||
".config/fastfetch/config.jsonc".source = ./dotfiles/fastfetch.jsonc;
|
||||
".config/helix/config.toml".source = ./dotfiles/helix/helix.toml;
|
||||
".config/helix/languages.toml".source = ./dotfiles/helix/helix-languages.toml;
|
||||
}
|
||||
|
||||
(mkVim ./dotfiles/vim/langs/tab2.vim ["javascript" "typescript" "html" "css" "json" "nix" "vim"])
|
||||
(mkVim ./dotfiles/vim/langs/tab4.vim ["python" "rust" "java" "lua" "c" "cpp" "h" "hpp"])
|
||||
(mkVim ./dotfiles/vim/langs/tabs.vim ["go" "make"])
|
||||
(mkVim ./dotfiles/vim/langs/lisp.vim ["lisp" "scheme" "clojure" "racket"])
|
||||
];
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
--
|
||||
-- Add any additional autocmds here
|
||||
-- with `vim.api.nvim_create_autocmd`
|
||||
--
|
||||
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
|
||||
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
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)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = {
|
||||
enabled = true, -- check for plugin updates periodically
|
||||
notify = false, -- notify on update
|
||||
}, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "gruvbox",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
-- since this is just an example spec, don't actually load anything here and return an empty spec
|
||||
-- stylua: ignore
|
||||
if true then return {} end
|
||||
|
||||
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
|
||||
--
|
||||
-- In your plugin files, you can:
|
||||
-- * add extra plugins
|
||||
-- * disable/enabled LazyVim plugins
|
||||
-- * override the configuration of LazyVim plugins
|
||||
return {
|
||||
-- add gruvbox
|
||||
{ "ellisonleao/gruvbox.nvim" },
|
||||
|
||||
-- Configure LazyVim to load gruvbox
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "gruvbox",
|
||||
},
|
||||
},
|
||||
|
||||
-- change trouble config
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
-- opts will be merged with the parent spec
|
||||
opts = { use_diagnostic_signs = true },
|
||||
},
|
||||
|
||||
-- disable trouble
|
||||
{ "folke/trouble.nvim", enabled = false },
|
||||
|
||||
-- override nvim-cmp and add cmp-emoji
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { "hrsh7th/cmp-emoji" },
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "emoji" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- change some telescope options and a keymap to browse plugin files
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
-- add a keymap to browse plugin files
|
||||
-- stylua: ignore
|
||||
{
|
||||
"<leader>fp",
|
||||
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||
desc = "Find Plugin File",
|
||||
},
|
||||
},
|
||||
-- change some options
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add pyright to lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||
pyright = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"jose-elias-alvarez/typescript.nvim",
|
||||
init = function()
|
||||
require("lazyvim.util").lsp.on_attach(function(_, buffer)
|
||||
-- stylua: ignore
|
||||
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
|
||||
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||
tsserver = {},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
tsserver = function(_, opts)
|
||||
require("typescript").setup({ server = opts })
|
||||
return true
|
||||
end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
|
||||
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
-- add more treesitter parsers
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||
-- would overwrite `ensure_installed` with the new value.
|
||||
-- If you'd rather extend the default config, use the code below instead:
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- add tsx and treesitter
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"tsx",
|
||||
"typescript",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- the opts function can also be used to change the default opts:
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, {
|
||||
function()
|
||||
return "😄"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- or you can return new options to override all the defaults
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return {
|
||||
--[[add your custom lualine config here]]
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- use mini.starter instead of alpha
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
|
||||
|
||||
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
|
||||
-- add any tools you want to have installed below
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"flake8",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
column_width = 120
|
||||
10
users/coyote/dotfiles/vim/langs/lisp.vim
Normal file
10
users/coyote/dotfiles/vim/langs/lisp.vim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
setlocal expandtab
|
||||
setlocal tabstop=2
|
||||
setlocal shiftwidth=2
|
||||
setlocal softtabstop=2
|
||||
|
||||
setlocal lisp
|
||||
setlocal autoindent
|
||||
setlocal showmatch
|
||||
|
||||
setlocal lispwords+=defmacro,defmethod,define-syntax,let,let*,letre,cond
|
||||
4
users/coyote/dotfiles/vim/langs/tab2.vim
Normal file
4
users/coyote/dotfiles/vim/langs/tab2.vim
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
setlocal expandtab
|
||||
setlocal tabstop=2
|
||||
setlocal shiftwidth=2
|
||||
setlocal softtabstop=2
|
||||
4
users/coyote/dotfiles/vim/langs/tab4.vim
Normal file
4
users/coyote/dotfiles/vim/langs/tab4.vim
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
setlocal expandtab
|
||||
setlocal tabstop=4
|
||||
setlocal shiftwidth=4
|
||||
setlocal softtabstop=4
|
||||
4
users/coyote/dotfiles/vim/langs/tabs.vim
Normal file
4
users/coyote/dotfiles/vim/langs/tabs.vim
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
setlocal tabstop=4
|
||||
setlocal shiftwidth=4
|
||||
setlocal noexpandtab
|
||||
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
set nocompatible
|
||||
set encoding=utf-8
|
||||
set backspace=indent,eol,start
|
||||
set clipboard=unnamedplus
|
||||
set mouse=a
|
||||
set history=1000
|
||||
set updatetime=300
|
||||
|
||||
syntax on
|
||||
set ruler
|
||||
set showcmd
|
||||
set showmode
|
||||
set laststatus=2
|
||||
set wildmenu
|
||||
set wildmode=longest,list,full
|
||||
set ttyfast
|
||||
set lazyredraw
|
||||
|
||||
filetype plugin indent on
|
||||
set autoindent
|
||||
set smartindent
|
||||
set expandtab
|
||||
set smarttab
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
|
||||
set hlsearch
|
||||
set incsearch
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set showmatch
|
||||
|
||||
" vim-plug auto-install & config
|
||||
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
||||
if empty(glob(data_dir . '/autoload/plug.vim'))
|
||||
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||
endif
|
||||
|
||||
call plug#begin()
|
||||
Plug 'junegunn/vim-plug'
|
||||
Plug 'luochen1990/rainbow'
|
||||
Plug 'mhinz/vim-signify'
|
||||
Plug 'vim-airline/vim-airline'
|
||||
call plug#end()
|
||||
|
||||
let g:rainbow_active = 1
|
||||
|
|
@ -3,16 +3,19 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
mkVimFt = src: langs:
|
||||
builtins.listToAttrs (map (lang: {
|
||||
name = ".vim/after/ftplugin/${lang}.vim";
|
||||
value = {source = src;};
|
||||
})
|
||||
langs);
|
||||
programsDir = ./programs;
|
||||
programsImports = map (name: programsDir + "/${name}") (
|
||||
builtins.filter
|
||||
(name: builtins.match ".*\\.nix" name != null)
|
||||
(builtins.attrNames (builtins.readDir programsDir))
|
||||
);
|
||||
in {
|
||||
imports = [
|
||||
./dotfiles.nix
|
||||
] ++ programsImports;
|
||||
|
||||
home = {
|
||||
stateVersion = "26.05"; # I hope you know what you're doing. :)
|
||||
|
||||
username = "coyote";
|
||||
homeDirectory = "/home/coyote";
|
||||
shell.enableShellIntegration = true;
|
||||
|
|
@ -41,35 +44,9 @@ in {
|
|||
# emulation
|
||||
(unstable.bottles.override {removeWarningPopup = true;})
|
||||
];
|
||||
|
||||
file = lib.mkMerge [
|
||||
{
|
||||
".vimrc".source = ./dotfiles/vim/vimrc;
|
||||
".config/fastfetch/config.jsonc".source = ./dotfiles/fastfetch.jsonc;
|
||||
".config/helix/config.toml".source = ./dotfiles/helix/helix.toml;
|
||||
".config/helix/languages.toml".source = ./dotfiles/helix/helix-languages.toml;
|
||||
".config/nvim" = {
|
||||
source = ./dotfiles/nvim;
|
||||
recursive = true;
|
||||
};
|
||||
}
|
||||
(mkVimFt ./dotfiles/vim/vim-tab2 ["javascript" "typescript" "html" "css" "json" "nix" "vim"])
|
||||
(mkVimFt ./dotfiles/vim/vim-tab4 ["python" "rust" "java" "lua" "c" "cpp" "h" "hpp"])
|
||||
(mkVimFt ./dotfiles/vim/vim-tabs ["go" "make"])
|
||||
(mkVimFt ./dotfiles/vim/vim-lisp ["lisp" "scheme" "clojure" "racket"])
|
||||
];
|
||||
};
|
||||
|
||||
programs = {
|
||||
vim = {
|
||||
enable = true;
|
||||
packageConfigurable = pkgs.unstable.vim-full;
|
||||
defaultEditor = true;
|
||||
};
|
||||
neovim = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.neovim-unwrapped;
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
|||
9
users/coyote/programs/neovim.nix
Normal file
9
users/coyote/programs/neovim.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
99
users/coyote/programs/vim.nix
Normal file
99
users/coyote/programs/vim.nix
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.vim = {
|
||||
enable = true;
|
||||
packageConfigurable = pkgs.unstable.vim-full;
|
||||
plugins = with pkgs.unstable.vimPlugins; [
|
||||
gruvbox
|
||||
vim-surround
|
||||
vim-commentary
|
||||
vim-easymotion
|
||||
vim-visual-multi
|
||||
fzf-vim
|
||||
vim-signify
|
||||
vim-airline
|
||||
rainbow
|
||||
];
|
||||
defaultEditor = true;
|
||||
extraConfig = ''
|
||||
set nocompatible
|
||||
set encoding=utf-8
|
||||
set backspace=indent,eol,start
|
||||
set clipboard=unnamedplus
|
||||
set mouse=a
|
||||
set history=1000
|
||||
set updatetime=300
|
||||
|
||||
syntax on
|
||||
set ruler
|
||||
set showcmd
|
||||
set showmode
|
||||
set laststatus=2
|
||||
set wildmenu
|
||||
set wildmode=longest,list,full
|
||||
set ttyfast
|
||||
set lazyredraw
|
||||
|
||||
filetype plugin indent on
|
||||
set autoindent
|
||||
set smartindent
|
||||
set expandtab
|
||||
set smarttab
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
|
||||
set hlsearch
|
||||
set incsearch
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set showmatch
|
||||
|
||||
" gruvbox
|
||||
set termguicolors
|
||||
set background=dark
|
||||
colorscheme gruvbox
|
||||
|
||||
" airline
|
||||
let g:airline_powerline_fonts = 1
|
||||
let g:airline_theme = 'gruvbox'
|
||||
let g:airline_section_a = '''
|
||||
let g:airline_section_y = '''
|
||||
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#whitespace#enabled = 1
|
||||
let g:airline#extensions#signify#enabled = 1
|
||||
let g:airline#extensions#term#enabled = 0
|
||||
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
|
||||
let g:airline#extensions#tabline#show_splits = 0
|
||||
let g:airline#extensions#tabline#show_tabs = 0
|
||||
|
||||
let g:airline#extensions#empty_sections = 1
|
||||
|
||||
" rainbow
|
||||
let g:rainbow_active = 1
|
||||
|
||||
" fzf
|
||||
let $COLORTERM = 'truecolor'
|
||||
let $FZF_DEFAULT_OPTS='--reverse --info=inline'
|
||||
let g:fzf_colors = {}
|
||||
let g:fzf_colors["fg"] = ["fg", "Normal"]
|
||||
let g:fzf_colors["bg"] = ["bg", "Normal"]
|
||||
let g:fzf_colors["hl"] = ["fg", "Comment"]
|
||||
let g:fzf_colors["fg+"] = ["fg", "CursorLine", "CursorColumn", "Normal"]
|
||||
let g:fzf_colors["bg+"] = ["bg", "CursorLine", "CursorColumn"]
|
||||
let g:fzf_colors["hl+"] = ["fg", "Statement"]
|
||||
let g:fzf_colors["info"] = ["fg", "PreProc"]
|
||||
let g:fzf_colors["border"] = ["fg", "Ignore"]
|
||||
let g:fzf_colors["prompt"] = ["fg", "Conditional"]
|
||||
let g:fzf_colors["pointer"] = ["fg", "Exception"]
|
||||
let g:fzf_colors["marker"] = ["fg", "Keyword"]
|
||||
let g:fzf_colors["spinner"] = ["fg", "Label"]
|
||||
let g:fzf_colors["header"] = ["fg", "Comment"]
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in a new issue