-
Notifications
You must be signed in to change notification settings - Fork 13
/
vim.nix
87 lines (77 loc) · 2.28 KB
/
vim.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{ pkgs, ... }:
{
programs.neovim = {
enable = true;
package = pkgs.neovim-unwrapped;
catppuccin.enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraLuaConfig = ''
vim.opt.autochdir = true
vim.opt.backup = false
vim.opt.autoindent = true
vim.opt.cindent = true
vim.opt.smartindent = true
vim.opt.expandtab = true
vim.opt.shiftwidth = 2
vim.opt.smarttab = true
vim.opt.softtabstop = 2
vim.opt.tabstop = 2
vim.opt.backspace = "indent,eol,start"
vim.g.mapleader = ';'
vim.g.maplocalleader = ';'
vim.opt.hlsearch = true
vim.opt.ignorecase = true
vim.opt.showmatch = true
vim.opt.number = true
vim.opt.background = dark
vim.opt.termguicolors = true
function map(mode, lhs, rhs, opts)
local options = {noremap = true, silent = true}
if opts then
options = vim.tbl_extend("force", options, opts)
end
vim.keymap.set(mode, lhs, rhs, options)
end
map('n', '<leader>t', ':ToggleTerm<CR>' )
map('i', '<leader><leader>', '<Esc>' )
map('t', '<Esc>', '<C-\\><C-n>' )
map('n', '<leader>p', ':NvimTreeToggle<CR>' )
map('n', '<leader><Space>', ':NvimTreeToggle<CR>' )
map('n', '<leader>ff', ':Telescope find_files<CR>')
map('n', '<leader>fg', ':Telescope live_grep<CR>' )
map('n', '<leader>fb', ':Telescope buffers<CR>' )
map('n', '<leader>fh', ':Telescope help_tags<CR>' )
map('n', '<leader>fo', ':Telescope vim_options<CR>' )
vim.cmd.colorscheme "catppuccin"
'';
plugins = with pkgs.vimPlugins; [
nvim-web-devicons
telescope-nvim
vim-nix
vim-visual-multi
{
plugin = nvim-comment;
type = "lua";
config = ''
require('nvim_comment').setup()
'';
}
{
plugin = nvim-tree-lua;
type = "lua";
config = ''
require('nvim-tree').setup({ update_cwd = true })
'';
}
{
plugin = lightline-vim;
type = "viml";
config = ''
let g:lightline = {'colorscheme': 'catppuccin'}
'';
}
];
};
}