mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 08:55:16 -06:00
add oil, colors
This commit is contained in:
parent
916bb1bf5d
commit
6e5ab46a79
11 changed files with 139 additions and 72 deletions
|
|
@ -1,6 +1,2 @@
|
|||
require("blankline-conf")
|
||||
require("nvim-conf")
|
||||
require("minimal-init")
|
||||
require("nvim-treesitter-conf")
|
||||
require("telescope-conf")
|
||||
require("toggleterm-conf")
|
||||
require("mini-conf")
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
vim.cmd([[ hi IndentBlanklineChar ctermfg=240 ]])
|
||||
vim.cmd([[ hi IndentBlanklineContextChar ctermfg=7 ]])
|
||||
-- require("indent_blankline").setup {
|
||||
-- show_current_context = true,
|
||||
-- show_current_context_start = true,
|
||||
-- }
|
||||
32
config/lua/gitsigns-conf.lua
Normal file
32
config/lua/gitsigns-conf.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
require('gitsigns').setup{
|
||||
signs = {
|
||||
add = { text = '✓'},
|
||||
change = { text = '↔'},
|
||||
delete = { text = '✗'},
|
||||
},
|
||||
signcolumn = auto,
|
||||
on_attach = function()
|
||||
vim.wo.signcolumn = "yes"
|
||||
vim.cmd [[ hi SignColumn ctermbg=none]]
|
||||
vim.cmd [[ hi GitSignsAdd ctermbg=none]]
|
||||
vim.cmd [[ hi GitSignsDelete ctermbg=none]]
|
||||
vim.cmd [[ hi GitSignsChange ctermbg=none]]
|
||||
end
|
||||
}
|
||||
|
||||
require("neogit").setup({
|
||||
disable_context_highlighting = true
|
||||
})
|
||||
vim.cmd [[ hi DiffAdd ctermbg=none ]]
|
||||
vim.cmd [[ hi DiffDelete ctermbg=none ]]
|
||||
vim.cmd [[ hi DiffContext ctermbg=none ]]
|
||||
vim.cmd [[ hi NeogitHunkHeader ctermbg=none ]]
|
||||
vim.cmd [[ hi NeogitHunkHeader ctermbg=none ]]
|
||||
|
||||
require("rose-pine").setup({
|
||||
variant = "moon",
|
||||
disable_background = true,
|
||||
disable_float_background = true
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme "rose-pine"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("vim-go")
|
||||
}
|
||||
|
|
@ -36,6 +36,7 @@ vim.opt.splitbelow = true
|
|||
vim.opt.splitright = true
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.tabstop = 4 -- 4 space tabs
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.undofile = true -- enable auto save of undos
|
||||
vim.opt.updatetime = 250 -- decrease update time
|
||||
vim.opt.virtualedit = "onemore"
|
||||
|
|
@ -49,6 +50,8 @@ vim.g.indent_blankline_use_treesitter = true
|
|||
|
||||
-- highlight indents
|
||||
vim.cmd([[ hi Whitespace ctermfg=240 ]])
|
||||
-- highlight floats
|
||||
vim.cmd([[ hi NormalFloat ctermbg=none ]])
|
||||
-- mappings
|
||||
----------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ require("nvim-treesitter.configs").setup {
|
|||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
['ac'] = '@comment.outer',
|
||||
['ic'] = '@comment.inner',
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["aa"] = "@call.inner",
|
||||
|
|
@ -25,18 +23,10 @@ require("nvim-treesitter.configs").setup {
|
|||
[']]'] = '@function.outer',
|
||||
[']m'] = '@class.outer',
|
||||
},
|
||||
goto_next_end = {
|
||||
[']['] = '@function.outer',
|
||||
[']M'] = '@class.outer',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[['] = '@function.outer',
|
||||
['[m'] = '@class.outer',
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[]'] = '@function.outer',
|
||||
['[M'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
},
|
||||
incremental_selection = {
|
||||
|
|
|
|||
14
config/lua/oil-conf.lua
Normal file
14
config/lua/oil-conf.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local oil = require('oil')
|
||||
oil.setup({
|
||||
columns = {
|
||||
"permissions",
|
||||
"size"
|
||||
},
|
||||
view_options = {
|
||||
show_hidden = true
|
||||
},
|
||||
keymaps = {
|
||||
["wq"] = "actions.close"
|
||||
}
|
||||
})
|
||||
vim.keymap.set("n", "<leader>c", oil.open, {noremap = true, silent = true});
|
||||
|
|
@ -11,7 +11,8 @@ vim.keymap.set("n", "<leader>fr", telescope.lsp_references, {noremap = true, sil
|
|||
-- fix highlighting
|
||||
vim.cmd([[ hi telescopeselection ctermfg=242 ctermbg=252 ]])
|
||||
|
||||
require("telescope").setup({
|
||||
local telescope = require("telescope")
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
layout_strategy = "vertical",
|
||||
layout_config = { width = .90, },
|
||||
|
|
@ -47,3 +48,4 @@ require("telescope").setup({
|
|||
},
|
||||
}
|
||||
})
|
||||
telescope.load_extension("fzf")
|
||||
|
|
|
|||
6
config/minimal-init.lua
Normal file
6
config/minimal-init.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
require("nvim-conf")
|
||||
require("telescope-conf")
|
||||
require("toggleterm-conf")
|
||||
require("mini-conf")
|
||||
require("gitsigns-conf")
|
||||
require("oil-conf")
|
||||
82
flake.nix
82
flake.nix
|
|
@ -9,12 +9,29 @@
|
|||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
plugins = import ./plugins.nix {
|
||||
inherit pkgs;
|
||||
};
|
||||
base = {
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
withRuby = false;
|
||||
withPython3 = false;
|
||||
extraMakeWrapperArgs = ''--prefix PATH : "${pkgs.lib.makeBinPath dependancies}"'';
|
||||
};
|
||||
dependancies = with pkgs; [
|
||||
bash fd fzf gopls ripgrep
|
||||
ripgrep
|
||||
];
|
||||
full-dependancies = with pkgs; [
|
||||
gopls
|
||||
] ++ dependancies;
|
||||
neovim-with-deps = recursiveMerge [
|
||||
pkgs.neovim-unwrapped
|
||||
{buildInputs = dependancies;}
|
||||
{ buildInputs = dependancies; }
|
||||
];
|
||||
neovim-with-full-deps = recursiveMerge [
|
||||
pkgs.neovim-unwrapped
|
||||
{ buildInputs = dependancies; }
|
||||
];
|
||||
recursiveMerge = attrList: let
|
||||
f = attrPath:
|
||||
|
|
@ -29,57 +46,42 @@
|
|||
in
|
||||
f [] attrList;
|
||||
in rec {
|
||||
packages.iofqvim = pkgs.wrapNeovim neovim-with-deps {
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
withRuby = false;
|
||||
withPython3 = false;
|
||||
extraMakeWrapperArgs = ''--prefix PATH : "${pkgs.lib.makeBinPath dependancies}"'';
|
||||
packages.full = pkgs.wrapNeovim neovim-with-full-deps (base // {
|
||||
configure = {
|
||||
customRC =
|
||||
''
|
||||
lua << EOF
|
||||
package.path = "${self}/config/lua/?.lua;" .. package.path
|
||||
package.path = "${self}/config/?.lua;" .. "${self}/config/lua/?.lua;" .. package.path
|
||||
''
|
||||
+ pkgs.lib.readFile ./config/init.lua
|
||||
+ ''
|
||||
EOF
|
||||
'';
|
||||
packages.plugins = with pkgs.vimPlugins; {
|
||||
start = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
toggleterm-nvim
|
||||
mini-nvim
|
||||
vim-go
|
||||
vim-nix
|
||||
(nvim-treesitter.withPlugins
|
||||
(
|
||||
plugins: with plugins; [
|
||||
tree-sitter-bash
|
||||
tree-sitter-c
|
||||
tree-sitter-dockerfile
|
||||
tree-sitter-go
|
||||
tree-sitter-javascript
|
||||
tree-sitter-json
|
||||
tree-sitter-lua
|
||||
tree-sitter-markdown
|
||||
tree-sitter-nix
|
||||
tree-sitter-php
|
||||
tree-sitter-python
|
||||
tree-sitter-yaml
|
||||
]
|
||||
)
|
||||
)
|
||||
nvim-treesitter-textobjects
|
||||
leap-nvim
|
||||
];
|
||||
start = plugins.base ++ plugins.treesitter;
|
||||
};
|
||||
};
|
||||
});
|
||||
packages.minimal = pkgs.wrapNeovim neovim-with-deps (base // {
|
||||
configure = {
|
||||
customRC =
|
||||
''
|
||||
lua << EOF
|
||||
package.path = "${self}/config/?.lua;" .. "${self}/config/lua/?.lua;" .. package.path
|
||||
''
|
||||
+ pkgs.lib.readFile ./config/minimal-init.lua
|
||||
+ ''
|
||||
EOF
|
||||
'';
|
||||
packages.plugins = with pkgs.vimPlugins; {
|
||||
start = plugins.base;
|
||||
};
|
||||
apps.iofqvim = flake-utils.lib.mkApp {
|
||||
drv = packages.iofqvim; name = "iofqvim"; exePath = "/bin/nvim";
|
||||
};
|
||||
apps.default = apps.iofqvim;
|
||||
packages.default = packages.iofqvim;
|
||||
});
|
||||
apps.full = flake-utils.lib.mkApp {
|
||||
drv = packages.full; name = "neovim"; exePath = "/bin/nvim";
|
||||
};
|
||||
apps.default = apps.full;
|
||||
packages.default = packages.full;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
35
plugins.nix
Normal file
35
plugins.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{pkgs, ...}:
|
||||
{
|
||||
base = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
toggleterm-nvim
|
||||
mini-nvim
|
||||
gitsigns-nvim
|
||||
oil-nvim
|
||||
neogit
|
||||
rose-pine
|
||||
];
|
||||
treesitter = with pkgs.vimPlugins; [
|
||||
(nvim-treesitter.withPlugins
|
||||
(
|
||||
plugins: with plugins; [
|
||||
tree-sitter-bash
|
||||
tree-sitter-c
|
||||
tree-sitter-dockerfile
|
||||
tree-sitter-go
|
||||
tree-sitter-javascript
|
||||
tree-sitter-json
|
||||
tree-sitter-lua
|
||||
tree-sitter-markdown
|
||||
tree-sitter-markdown-inline
|
||||
tree-sitter-nix
|
||||
tree-sitter-php
|
||||
tree-sitter-python
|
||||
tree-sitter-yaml
|
||||
]
|
||||
)
|
||||
)
|
||||
nvim-treesitter-textobjects
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue