nix: add nix and lua formatters
This commit is contained in:
parent
72e36b3088
commit
65dcb3784d
27 changed files with 244 additions and 243 deletions
18
.gitignore
vendored
18
.gitignore
vendored
|
@ -1,18 +1,4 @@
|
||||||
/*
|
/secrets.nix
|
||||||
|
|
||||||
!/.gitignore
|
/wallpapers/*.jpg
|
||||||
!/*.example.nix
|
|
||||||
|
|
||||||
!/notes
|
|
||||||
|
|
||||||
!/programs
|
|
||||||
!/scripts
|
|
||||||
|
|
||||||
!/system
|
|
||||||
!/home
|
|
||||||
|
|
||||||
!/wallpapers
|
|
||||||
/wallpapers/*
|
|
||||||
!/wallpapers/*.png
|
|
||||||
!/wallpapers/build.sh
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ in
|
||||||
model = "pc105";
|
model = "pc105";
|
||||||
layout = "us,ru";
|
layout = "us,ru";
|
||||||
variant = "dvorak,";
|
variant = "dvorak,";
|
||||||
options = ["grp:win_space_toggle"];
|
options = [ "grp:win_space_toggle" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
@ -25,25 +25,25 @@ in
|
||||||
docker-compose
|
docker-compose
|
||||||
libreoffice
|
libreoffice
|
||||||
|
|
||||||
asciinema # record the terminal
|
asciinema # record the terminal
|
||||||
neofetch # command-line system information
|
neofetch # command-line system information
|
||||||
alacritty
|
alacritty
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
xh # friendly and fast tool for sending HTTP requests
|
xh # friendly and fast tool for sending HTTP requests
|
||||||
fd # a simple, fast and user-friendly alternative to find
|
fd # a simple, fast and user-friendly alternative to find
|
||||||
bat # a cat clone with syntax highlighting and git integration
|
bat # a cat clone with syntax highlighting and git integration
|
||||||
|
|
||||||
# haskell
|
# haskell
|
||||||
stylish-haskell # formatter
|
stylish-haskell # formatter
|
||||||
|
|
||||||
# browser
|
# browser
|
||||||
librewolf # a fork of firefox, focused on privacy, security and freedom
|
librewolf # a fork of firefox, focused on privacy, security and freedom
|
||||||
|
|
||||||
# for work
|
# for work
|
||||||
google-cloud-sdk
|
google-cloud-sdk
|
||||||
kubectl
|
kubectl
|
||||||
postgresql_12 # 🤷 I need only psql
|
postgresql_12 # 🤷 I need only psql
|
||||||
];
|
];
|
||||||
|
|
||||||
# user interface
|
# user interface
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
font =
|
font =
|
||||||
let
|
let
|
||||||
family = "Fira Code";
|
family = "Fira Code";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
normal = {
|
normal = {
|
||||||
inherit family;
|
inherit family;
|
||||||
style = "Regular";
|
style = "Regular";
|
||||||
|
@ -40,5 +41,5 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
size = 11.0;
|
size = 11.0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
languageserver = {
|
languageserver = {
|
||||||
nix = {
|
nix = {
|
||||||
command = "rnix-lsp";
|
command = "rnix-lsp";
|
||||||
filetypes = ["nix"];
|
filetypes = [ "nix" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
haskell = {
|
haskell = {
|
||||||
command = "haskell-language-server-wrapper";
|
command = "haskell-language-server-wrapper";
|
||||||
args = ["--lsp"];
|
args = [ "--lsp" ];
|
||||||
rootPatterns = [
|
rootPatterns = [
|
||||||
"stack.yaml"
|
"stack.yaml"
|
||||||
".cabal"
|
".cabal"
|
||||||
|
|
|
@ -12,31 +12,30 @@ let
|
||||||
plugins = pkgs.vimPlugins // customPlugins;
|
plugins = pkgs.vimPlugins // customPlugins;
|
||||||
|
|
||||||
myVimPlugins = with plugins; [
|
myVimPlugins = with plugins; [
|
||||||
coc-tsserver # typescript LSP
|
coc-tsserver # typescript LSP
|
||||||
coc-eslint # eslint LSP
|
coc-eslint # eslint LSP
|
||||||
coc-rust-analyzer # rust LSP
|
coc-rust-analyzer # rust LSP
|
||||||
|
|
||||||
editorconfig-vim # use project .editorconfig to configure editor
|
editorconfig-vim # use project .editorconfig to configure editor
|
||||||
lightline-vim # configurable status line
|
lightline-vim # configurable status line
|
||||||
material-vim # modern theme with true colors support
|
material-vim # modern theme with true colors support
|
||||||
vim-nix # nix support
|
vim-nix # nix support
|
||||||
vim-easymotion # highlights keys to move quickly
|
vim-easymotion # highlights keys to move quickly
|
||||||
vim-gitgutter # shows git diff markers in the sign column
|
vim-gitgutter # shows git diff markers in the sign column
|
||||||
nerdtree # tree explorer
|
nerdtree # tree explorer
|
||||||
nerdtree-git-plugin # shows files git status on the NerdTree
|
nerdtree-git-plugin # shows files git status on the NerdTree
|
||||||
neoformat # formating code
|
neoformat # formating code
|
||||||
nvim-treesitter # treesitter configurations and abstraction layer
|
nvim-treesitter # treesitter configurations and abstraction layer
|
||||||
fzf-vim # fuzzy finder
|
fzf-vim # fuzzy finder
|
||||||
blamer-nvim # A git blame plugin
|
blamer-nvim # A git blame plugin
|
||||||
];
|
];
|
||||||
|
|
||||||
# Additional language servers that we should install mannually
|
# Additional language servers that we should install mannually
|
||||||
lspPackages = with pkgs; [ rnix-lsp ];
|
lspPackages = with pkgs; [ rnix-lsp ];
|
||||||
# Additional tools
|
# Additional tools
|
||||||
toolsPackages = with pkgs; [
|
fzfToolsPackages = with pkgs; [ fzf ripgrep ];
|
||||||
fzf ripgrep # required for `fzf-vim` plugin
|
|
||||||
];
|
additionalPackages = lspPackages ++ fzfToolsPackages;
|
||||||
additionalPackages = lspPackages ++ toolsPackages;
|
|
||||||
|
|
||||||
vimConfig = builtins.readFile ./config.vim;
|
vimConfig = builtins.readFile ./config.vim;
|
||||||
in
|
in
|
||||||
|
@ -79,4 +78,3 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,15 +3,15 @@
|
||||||
-- Basic Settings
|
-- Basic Settings
|
||||||
--
|
--
|
||||||
|
|
||||||
vim.cmd 'filetype off'
|
vim.cmd("filetype off")
|
||||||
|
|
||||||
-- Leaders
|
-- Leaders
|
||||||
vim.g.mapleader = ','
|
vim.g.mapleader = ","
|
||||||
vim.g.maplocalleader = '-'
|
vim.g.maplocalleader = "-"
|
||||||
|
|
||||||
-- Better Unix support
|
-- Better Unix support
|
||||||
vim.opt.viewoptions = {'folds', 'options', 'cursor', 'unix', 'slash'}
|
vim.opt.viewoptions = { "folds", "options", "cursor", "unix", "slash" }
|
||||||
vim.opt.encoding = 'utf-8'
|
vim.opt.encoding = "utf-8"
|
||||||
|
|
||||||
-- True color support
|
-- True color support
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
@ -20,13 +20,13 @@ vim.opt.termguicolors = true
|
||||||
-- Available styles: default, planight, ocean, lighter
|
-- Available styles: default, planight, ocean, lighter
|
||||||
-- darker, default-community, palenight-community, ocean-community,
|
-- darker, default-community, palenight-community, ocean-community,
|
||||||
-- lighter-community, darker-community
|
-- lighter-community, darker-community
|
||||||
vim.g.material_theme_style = 'default'
|
vim.g.material_theme_style = "default"
|
||||||
vim.g.lightline = { colorscheme = 'material_vim' }
|
vim.g.lightline = { colorscheme = "material_vim" }
|
||||||
vim.cmd 'colorscheme material'
|
vim.cmd("colorscheme material")
|
||||||
|
|
||||||
-- Other options
|
-- Other options
|
||||||
vim.cmd 'syntax on'
|
vim.cmd("syntax on")
|
||||||
vim.opt.backspace = {'indent', 'eol', 'start'}
|
vim.opt.backspace = { "indent", "eol", "start" }
|
||||||
vim.opt.laststatus = 2
|
vim.opt.laststatus = 2
|
||||||
vim.opt.showmode = false
|
vim.opt.showmode = false
|
||||||
|
|
||||||
|
@ -37,13 +37,13 @@ vim.opt.softtabstop = 2
|
||||||
vim.opt.shiftwidth = 2
|
vim.opt.shiftwidth = 2
|
||||||
|
|
||||||
-- Fixes broken cursor on Linux
|
-- Fixes broken cursor on Linux
|
||||||
vim.opt.guicursor = ''
|
vim.opt.guicursor = ""
|
||||||
|
|
||||||
-- Disable mouse / touchpad
|
-- Disable mouse / touchpad
|
||||||
vim.opt.mouse = ''
|
vim.opt.mouse = ""
|
||||||
|
|
||||||
-- Incremental substitutin
|
-- Incremental substitutin
|
||||||
vim.opt.inccommand = 'split'
|
vim.opt.inccommand = "split"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
|
@ -67,17 +67,17 @@ vim.opt.showmatch = true
|
||||||
-- Time during which the matching parenthesis is shown.
|
-- Time during which the matching parenthesis is shown.
|
||||||
vim.opt.matchtime = 2
|
vim.opt.matchtime = 2
|
||||||
-- Sensible default line auto cutting and formatting.
|
-- Sensible default line auto cutting and formatting.
|
||||||
vim.opt.formatoptions = 'jtcrq'
|
vim.opt.formatoptions = "jtcrq"
|
||||||
-- Copy/Past to/from clipboard.
|
-- Copy/Past to/from clipboard.
|
||||||
vim.opt.clipboard = 'unnamedplus'
|
vim.opt.clipboard = "unnamedplus"
|
||||||
-- Highlight line cursor is currently on.
|
-- Highlight line cursor is currently on.
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
-- Invisible characters representation when :set list
|
-- Invisible characters representation when :set list
|
||||||
vim.opt.listchars = {
|
vim.opt.listchars = {
|
||||||
tab = '→ ',
|
tab = "→ ",
|
||||||
trail = '~',
|
trail = "~",
|
||||||
nbsp = '␣',
|
nbsp = "␣",
|
||||||
eol = '¬',
|
eol = "¬",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Search
|
-- Search
|
||||||
|
@ -89,7 +89,7 @@ vim.opt.ignorecase = true
|
||||||
vim.opt.smartcase = true
|
vim.opt.smartcase = true
|
||||||
|
|
||||||
-- Spell
|
-- Spell
|
||||||
vim.opt.spelllang = 'en,ru'
|
vim.opt.spelllang = "en,ru"
|
||||||
|
|
||||||
-- Fold level
|
-- Fold level
|
||||||
vim.opt.foldlevel = 99
|
vim.opt.foldlevel = 99
|
||||||
|
@ -101,105 +101,110 @@ vim.opt.foldnestmax = 5
|
||||||
--
|
--
|
||||||
-- File type specified
|
-- File type specified
|
||||||
--
|
--
|
||||||
local bufReadFile = {'BufNewFile', 'BufRead'}
|
local bufReadFile = { "BufNewFile", "BufRead" }
|
||||||
|
|
||||||
-- Set up a line limiter for each lang
|
-- Set up a line limiter for each lang
|
||||||
local line_limiter_augroup = vim.api.nvim_create_augroup('line_limiter', {})
|
local line_limiter_augroup = vim.api.nvim_create_augroup("line_limiter", {})
|
||||||
local function set_line_limiter(limit, patterns)
|
local function set_line_limiter(limit, patterns)
|
||||||
vim.api.nvim_create_autocmd(bufReadFile, {
|
vim.api.nvim_create_autocmd(bufReadFile, {
|
||||||
pattern = patterns,
|
pattern = patterns,
|
||||||
group = line_limiter_augroup,
|
group = line_limiter_augroup,
|
||||||
callback = function () vim.wo.colorcolumn = tostring(limit) end,
|
callback = function()
|
||||||
})
|
vim.wo.colorcolumn = tostring(limit)
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
set_line_limiter(101, {
|
set_line_limiter(101, {
|
||||||
'*.nix',
|
"*.nix",
|
||||||
'*.vim',
|
"*.vim",
|
||||||
'*.lua',
|
"*.lua",
|
||||||
'*.ts',
|
"*.ts",
|
||||||
'*.tsx',
|
"*.tsx",
|
||||||
'*.js',
|
"*.js",
|
||||||
'*.jsx',
|
"*.jsx",
|
||||||
'*.rs',
|
"*.rs",
|
||||||
})
|
})
|
||||||
set_line_limiter(81, {
|
set_line_limiter(81, {
|
||||||
'*.json',
|
"*.json",
|
||||||
'*.yml',
|
"*.yml",
|
||||||
'*.yaml',
|
"*.yaml",
|
||||||
'*.md',
|
"*.md",
|
||||||
'*.html',
|
"*.html",
|
||||||
'*.css',
|
"*.css",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Spell check for markdown files
|
-- Spell check for markdown files
|
||||||
local spell_check_augroup = vim.api.nvim_create_augroup('spell_check', {})
|
local spell_check_augroup = vim.api.nvim_create_augroup("spell_check", {})
|
||||||
vim.api.nvim_create_autocmd(bufReadFile, {
|
vim.api.nvim_create_autocmd(bufReadFile, {
|
||||||
pattern = { '*.md' },
|
pattern = { "*.md" },
|
||||||
group = spell_check_augroup,
|
group = spell_check_augroup,
|
||||||
callback = function () vim.wo.spell = true end,
|
callback = function()
|
||||||
|
vim.wo.spell = true
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Set up fold method for each lang
|
-- Set up fold method for each lang
|
||||||
local folding_augroup = vim.api.nvim_create_augroup('folding', {})
|
local folding_augroup = vim.api.nvim_create_augroup("folding", {})
|
||||||
vim.api.nvim_create_autocmd(bufReadFile, {
|
vim.api.nvim_create_autocmd(bufReadFile, {
|
||||||
group = folding_augroup,
|
group = folding_augroup,
|
||||||
pattern = {
|
pattern = {
|
||||||
'*.js',
|
"*.js",
|
||||||
'*.jsx',
|
"*.jsx",
|
||||||
'*.ts',
|
"*.ts",
|
||||||
'*.tsx',
|
"*.tsx",
|
||||||
},
|
},
|
||||||
callback = function ()
|
callback = function()
|
||||||
vim.cmd 'syntax on'
|
vim.cmd("syntax on")
|
||||||
vim.wo.foldmethod = 'syntax'
|
vim.wo.foldmethod = "syntax"
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- Bindings
|
-- Bindings
|
||||||
--
|
--
|
||||||
local function clear_search_hl() vim.opt.hlsearch = false end
|
local function clear_search_hl()
|
||||||
vim.keymap.set('n', '<C-z>', clear_search_hl, { desc = 'Clear search highlighting' })
|
vim.opt.hlsearch = false
|
||||||
|
end
|
||||||
|
vim.keymap.set("n", "<C-z>", clear_search_hl, { desc = "Clear search highlighting" })
|
||||||
|
|
||||||
-- Enable fast navigation between windows
|
-- Enable fast navigation between windows
|
||||||
vim.keymap.set('n', '<C-h>', '<C-W>h')
|
vim.keymap.set("n", "<C-h>", "<C-W>h")
|
||||||
vim.keymap.set('n', '<C-l>', '<C-W>l')
|
vim.keymap.set("n", "<C-l>", "<C-W>l")
|
||||||
vim.keymap.set('n', '<C-j>', '<C-W>j')
|
vim.keymap.set("n", "<C-j>", "<C-W>j")
|
||||||
vim.keymap.set('n', '<C-k>', '<C-W>k')
|
vim.keymap.set("n", "<C-k>", "<C-W>k")
|
||||||
|
|
||||||
-- Disable the annoying and useless ex-mode
|
-- Disable the annoying and useless ex-mode
|
||||||
vim.keymap.set('n', 'Q', '<nop>')
|
vim.keymap.set("n", "Q", "<nop>")
|
||||||
vim.keymap.set('n', 'gQ', '<nop>')
|
vim.keymap.set("n", "gQ", "<nop>")
|
||||||
|
|
||||||
-- Disable arrow keys
|
-- Disable arrow keys
|
||||||
vim.keymap.set('n', '<Up>', '<nop>')
|
vim.keymap.set("n", "<Up>", "<nop>")
|
||||||
vim.keymap.set('n', '<Down>', '<nop>')
|
vim.keymap.set("n", "<Down>", "<nop>")
|
||||||
vim.keymap.set('n', '<Left>', '<nop>')
|
vim.keymap.set("n", "<Left>", "<nop>")
|
||||||
vim.keymap.set('n', '<Right>', '<nop>')
|
vim.keymap.set("n", "<Right>", "<nop>")
|
||||||
vim.keymap.set('v', '<Up>', '<nop>')
|
vim.keymap.set("v", "<Up>", "<nop>")
|
||||||
vim.keymap.set('v', '<Down>', '<nop>')
|
vim.keymap.set("v", "<Down>", "<nop>")
|
||||||
vim.keymap.set('v', '<Left>', '<nop>')
|
vim.keymap.set("v", "<Left>", "<nop>")
|
||||||
vim.keymap.set('v', '<Right>', '<nop>')
|
vim.keymap.set("v", "<Right>", "<nop>")
|
||||||
-- ... instead of insert mode for rus lang
|
-- ... instead of insert mode for rus lang
|
||||||
vim.keymap.set('i', '<Up>', '<nop>')
|
vim.keymap.set("i", "<Up>", "<nop>")
|
||||||
vim.keymap.set('i', '<Down>', '<nop>')
|
vim.keymap.set("i", "<Down>", "<nop>")
|
||||||
vim.keymap.set('i', '<Left>', '<nop>')
|
vim.keymap.set("i", "<Left>", "<nop>")
|
||||||
vim.keymap.set('i', '<Right>', '<nop>')
|
vim.keymap.set("i", "<Right>", "<nop>")
|
||||||
|
|
||||||
-- Disable page up / down
|
-- Disable page up / down
|
||||||
vim.keymap.set('n', '<PageUp>', '<nop>')
|
vim.keymap.set("n", "<PageUp>", "<nop>")
|
||||||
vim.keymap.set('n', '<PageDown>', '<nop>')
|
vim.keymap.set("n", "<PageDown>", "<nop>")
|
||||||
vim.keymap.set('v', '<PageUp>', '<nop>')
|
vim.keymap.set("v", "<PageUp>", "<nop>")
|
||||||
vim.keymap.set('v', '<PageDown>', '<nop>')
|
vim.keymap.set("v", "<PageDown>", "<nop>")
|
||||||
vim.keymap.set('i', '<PageUp>', '<nop>')
|
vim.keymap.set("i", "<PageUp>", "<nop>")
|
||||||
vim.keymap.set('i', '<PageDown>', '<nop>')
|
vim.keymap.set("i", "<PageDown>", "<nop>")
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- Abbreviatures
|
-- Abbreviatures
|
||||||
--
|
--
|
||||||
vim.cmd 'cabbrev bsp belowright split'
|
vim.cmd("cabbrev bsp belowright split")
|
||||||
vim.cmd 'cabbrev rvsp belowright vsplit'
|
vim.cmd("cabbrev rvsp belowright vsplit")
|
||||||
|
|
|
@ -4,10 +4,10 @@ vim.opt.updatetime = 300
|
||||||
-- Coc don't use completeopt
|
-- Coc don't use completeopt
|
||||||
vim.opt.completeopt = {}
|
vim.opt.completeopt = {}
|
||||||
-- don't give |ins-completion-menu| messages.
|
-- don't give |ins-completion-menu| messages.
|
||||||
vim.opt.shortmess:append('c')
|
vim.opt.shortmess:append("c")
|
||||||
|
|
||||||
-- always show signcolumns
|
-- always show signcolumns
|
||||||
vim.opt.signcolumn = 'yes'
|
vim.opt.signcolumn = "yes"
|
||||||
|
|
||||||
-- Some server have issues with backup files, see coc#649
|
-- Some server have issues with backup files, see coc#649
|
||||||
vim.opt.backup = false
|
vim.opt.backup = false
|
||||||
|
@ -17,42 +17,42 @@ vim.opt.writebackup = false
|
||||||
vim.opt.cmdheight = 2
|
vim.opt.cmdheight = 2
|
||||||
|
|
||||||
-- Use <c-space> for trigger completion.
|
-- Use <c-space> for trigger completion.
|
||||||
vim.keymap.set('i', '<C-space>', vim.fn['coc#refresh'], {
|
vim.keymap.set("i", "<C-space>", vim.fn["coc#refresh"], {
|
||||||
silent = true,
|
silent = true,
|
||||||
expr = true
|
expr = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use <cr> for confirm completion, `<C-g>u` means break undo chain at current
|
-- Use <cr> for confirm completion, `<C-g>u` means break undo chain at current
|
||||||
-- position. Coc only does snippet and additional edit on confirm.
|
-- position. Coc only does snippet and additional edit on confirm.
|
||||||
local function confirm_coc_completion()
|
local function confirm_coc_completion()
|
||||||
if vim.call'coc#pum#visible' == 1 then
|
if vim.call("coc#pum#visible") == 1 then
|
||||||
vim.call'coc#pum#confirm'
|
vim.call("coc#pum#confirm")
|
||||||
return ""
|
return ""
|
||||||
else
|
else
|
||||||
return "<CR>"
|
return "<CR>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.keymap.set('i', '<CR>', confirm_coc_completion, { expr = true, silent = true })
|
vim.keymap.set("i", "<CR>", confirm_coc_completion, { expr = true, silent = true })
|
||||||
|
|
||||||
local sr_opts = { silent = true, remap = true }
|
local sr_opts = { silent = true, remap = true }
|
||||||
-- Use `[c` and `]c` for navigate diagnostics
|
-- Use `[c` and `]c` for navigate diagnostics
|
||||||
vim.keymap.set('n', '[c', '<Plug>(coc-diagnostic-prev)', sr_opts)
|
vim.keymap.set("n", "[c", "<Plug>(coc-diagnostic-prev)", sr_opts)
|
||||||
vim.keymap.set('n', ']c', '<Plug>(coc-diagnostic-next)', sr_opts)
|
vim.keymap.set("n", "]c", "<Plug>(coc-diagnostic-next)", sr_opts)
|
||||||
|
|
||||||
-- Remap keys for gotos
|
-- Remap keys for gotos
|
||||||
vim.keymap.set('n', 'gd', '<Plug>(coc-definition)', sr_opts)
|
vim.keymap.set("n", "gd", "<Plug>(coc-definition)", sr_opts)
|
||||||
vim.keymap.set('n', 'gy', '<Plug>(coc-type-definition)', sr_opts)
|
vim.keymap.set("n", "gy", "<Plug>(coc-type-definition)", sr_opts)
|
||||||
vim.keymap.set('n', 'gi', '<Plug>(coc-implementation)', sr_opts)
|
vim.keymap.set("n", "gi", "<Plug>(coc-implementation)", sr_opts)
|
||||||
vim.keymap.set('n', 'gr', '<Plug>(coc-references)', sr_opts)
|
vim.keymap.set("n", "gr", "<Plug>(coc-references)", sr_opts)
|
||||||
|
|
||||||
-- Remap for do code action of current line
|
-- Remap for do code action of current line
|
||||||
vim.keymap.set('n', '<localleader>a', '<Plug>(coc-codeaction)')
|
vim.keymap.set("n", "<localleader>a", "<Plug>(coc-codeaction)")
|
||||||
-- Remap for rename current word
|
-- Remap for rename current word
|
||||||
vim.keymap.set('n', '<localleader>n', '<Plug>(coc-rename)')
|
vim.keymap.set("n", "<localleader>n", "<Plug>(coc-rename)")
|
||||||
|
|
||||||
-- Mapping for CocList
|
-- Mapping for CocList
|
||||||
vim.keymap.set('n', '<localleader>cl', ':CocList<CR>')
|
vim.keymap.set("n", "<localleader>cl", ":CocList<CR>")
|
||||||
vim.keymap.set('n', '<localleader>cd', ':CocList diagnostics<CR>')
|
vim.keymap.set("n", "<localleader>cd", ":CocList diagnostics<CR>")
|
||||||
vim.keymap.set('n', '<localleader>cc', ':CocList commands<CR>')
|
vim.keymap.set("n", "<localleader>cc", ":CocList commands<CR>")
|
||||||
vim.keymap.set('n', '<localleader>co', ':CocList outline<CR>')
|
vim.keymap.set("n", "<localleader>co", ":CocList outline<CR>")
|
||||||
vim.keymap.set('n', '<localleader>cs', ':CocList symbols<CR>')
|
vim.keymap.set("n", "<localleader>cs", ":CocList symbols<CR>")
|
||||||
|
|
|
@ -3,27 +3,27 @@
|
||||||
-- NerdTree
|
-- NerdTree
|
||||||
--
|
--
|
||||||
|
|
||||||
vim.g.NERDTreeDirArrowExpandable = '▸'
|
vim.g.NERDTreeDirArrowExpandable = "▸"
|
||||||
vim.g.NERDTreeDirArrowCollapsible = '▾'
|
vim.g.NERDTreeDirArrowCollapsible = "▾"
|
||||||
|
|
||||||
vim.g.NERDTreeMiniamlUI = 1
|
vim.g.NERDTreeMiniamlUI = 1
|
||||||
vim.g.NERDTreeDirArrows = 1
|
vim.g.NERDTreeDirArrows = 1
|
||||||
|
|
||||||
-- Nerdtree git plugin symbols
|
-- Nerdtree git plugin symbols
|
||||||
vim.g.NERDTreeGitStatusIndicatorMapCustom = {
|
vim.g.NERDTreeGitStatusIndicatorMapCustom = {
|
||||||
Modified = 'ᵐ',
|
Modified = "ᵐ",
|
||||||
Staged = 'ˢ',
|
Staged = "ˢ",
|
||||||
Untracked = 'ᵘ',
|
Untracked = "ᵘ",
|
||||||
Renamed = 'ʳ',
|
Renamed = "ʳ",
|
||||||
Unmerged = 'ᶴ',
|
Unmerged = "ᶴ",
|
||||||
Deleted = 'ˣ',
|
Deleted = "ˣ",
|
||||||
Dirty = '˜',
|
Dirty = "˜",
|
||||||
Clean = 'ᵅ',
|
Clean = "ᵅ",
|
||||||
Unknown = '?',
|
Unknown = "?",
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>nt', ':NERDTreeToggle<CR>')
|
vim.keymap.set("n", "<leader>nt", ":NERDTreeToggle<CR>")
|
||||||
vim.keymap.set('n', '<leader>nf', ':NERDTreeFind<CR>')
|
vim.keymap.set("n", "<leader>nf", ":NERDTreeFind<CR>")
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
|
@ -31,14 +31,14 @@ vim.keymap.set('n', '<leader>nf', ':NERDTreeFind<CR>')
|
||||||
--
|
--
|
||||||
vim.g.neoformat_try_node_exe = 1
|
vim.g.neoformat_try_node_exe = 1
|
||||||
vim.g.neoformat_only_msg_on_error = 1
|
vim.g.neoformat_only_msg_on_error = 1
|
||||||
vim.g.neoformat_enabled_markdown = {"denofmt"}
|
vim.g.neoformat_enabled_markdown = { "denofmt" }
|
||||||
|
|
||||||
vim.cmd [[
|
vim.cmd([[
|
||||||
aug fmt
|
aug fmt
|
||||||
au!
|
au!
|
||||||
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
|
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
|
||||||
aug END
|
aug END
|
||||||
]]
|
]])
|
||||||
--[[ TODO: need to investigate how implement it in lua
|
--[[ TODO: need to investigate how implement it in lua
|
||||||
local format_augroup = vim.api.nvim_create_augroup('format', {})
|
local format_augroup = vim.api.nvim_create_augroup('format', {})
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
|
@ -53,7 +53,8 @@ vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
if not ok then vim.cmd'NeoFormat' end
|
if not ok then vim.cmd'NeoFormat' end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
]]--
|
]]
|
||||||
|
--
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
|
@ -63,30 +64,29 @@ vim.g.gitgutter_sign_priority = 1
|
||||||
vim.g.gitgutter_set_sign_backgrounds = 0
|
vim.g.gitgutter_set_sign_backgrounds = 0
|
||||||
vim.g.gitgutter_map_keys = 0
|
vim.g.gitgutter_map_keys = 0
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>ghp', ':GitGutterPreviewHunk<CR>')
|
vim.keymap.set("n", "<leader>ghp", ":GitGutterPreviewHunk<CR>")
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- TreeSitter
|
-- TreeSitter
|
||||||
--
|
--
|
||||||
require'nvim-treesitter.configs'.setup {
|
require("nvim-treesitter.configs").setup({
|
||||||
-- A list of parser names, or "all"
|
-- A list of parser names, or "all"
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"typescript",
|
"typescript",
|
||||||
"tsx",
|
"tsx",
|
||||||
"rust",
|
"rust",
|
||||||
"haskell",
|
"haskell",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
indent = {
|
indent = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
pkgs.neovim-unwrapped.overrideAttrs (
|
pkgs.neovim-unwrapped.overrideAttrs (
|
||||||
old: {
|
old: {
|
||||||
name = "neovim-nightly";
|
name = "neovim-nightly";
|
||||||
version = "nightly";
|
version = "nightly";
|
||||||
|
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "neovim";
|
owner = "neovim";
|
||||||
repo = "neovim";
|
repo = "neovim";
|
||||||
rev = "f17d88c47a6a647f2230a61e7cd952926abc4473";
|
rev = "f17d88c47a6a647f2230a61e7cd952926abc4473";
|
||||||
sha256 = "0lgbf90sbachdag1zm9pmnlbn35964l3khs27qy4462qzpqyi9fi";
|
sha256 = "0lgbf90sbachdag1zm9pmnlbn35964l3khs27qy4462qzpqyi9fi";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [pkgs.pass];
|
home.packages = [ pkgs.pass ];
|
||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
PASSWORD_STORE_DIR = "${pass_data_dir}/store";
|
PASSWORD_STORE_DIR = "${pass_data_dir}/store";
|
||||||
|
|
|
@ -16,7 +16,7 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
vifm # a vi-like file manager
|
vifm # a vi-like file manager
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, config, pkgs, ...}:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, config, pkgs, ...}:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, config, pkgs, ...}:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -17,10 +17,10 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
xclip # access x clipboard from a console
|
xclip # access x clipboard from a console
|
||||||
dmenu # menu for x window system
|
dmenu # menu for x window system
|
||||||
flameshot # powerful yet simple to use screenshot software
|
flameshot # powerful yet simple to use screenshot software
|
||||||
nitrogen # wallpaper manager
|
nitrogen # wallpaper manager
|
||||||
];
|
];
|
||||||
|
|
||||||
xsession = {
|
xsession = {
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
userEmail = "bross@example.com";
|
userEmail = "bross@example.com";
|
||||||
# gpg --list-secret-keys
|
# gpg --list-secret-keys
|
||||||
gpgSigningKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
gpgSigningKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||||
};
|
};
|
||||||
|
|
||||||
emailAccounts = {
|
emailAccounts = {
|
||||||
"personal" = {
|
"personal" = {
|
||||||
flavor = "yandex.com";
|
flavor = "yandex.com";
|
||||||
address = "bross@yandex.ru";
|
address = "bross@yandex.ru";
|
||||||
passwordCommand = "pass show emails/bross@yandex.ru";
|
passwordCommand = "pass show emails/bross@yandex.ru";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
}
|
|
||||||
|
|
8
shell.nix
Normal file
8
shell.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
|
pkgs.mkShell {
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
nixpkgs-fmt
|
||||||
|
stylua
|
||||||
|
];
|
||||||
|
}
|
|
@ -5,7 +5,8 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[
|
||||||
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
[
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ];
|
||||||
|
@ -14,18 +15,19 @@
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "/dev/disk/by-uuid/969c5f68-631d-4429-b81b-0d81e050449b";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/969c5f68-631d-4429-b81b-0d81e050449b";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" =
|
fileSystems."/home" =
|
||||||
{ device = "/dev/disk/by-uuid/e17fb0c0-9482-436d-83e8-3760772fe9b8";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/e17fb0c0-9482-436d-83e8-3760772fe9b8";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices =
|
||||||
[ { device = "/dev/disk/by-uuid/1be15503-cd51-4c57-bb91-04f45a964202"; }
|
[{ device = "/dev/disk/by-uuid/1be15503-cd51-4c57-bb91-04f45a964202"; }];
|
||||||
];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
|
Loading…
Reference in a new issue