20.05.2025

This commit is contained in:
Alexander Neonxp Kiryukhin 2025-04-20 17:24:11 +03:00
parent 4bff377885
commit 57fc86a2cc
Signed by: NeonXP
SSH key fingerprint: SHA256:SVt7TjxbVc87m1QYaQziOJ0N3OCFURv2g76gD/UTTXI
11 changed files with 126 additions and 86 deletions

3
.gitmodules vendored
View file

@ -1,3 +1,6 @@
[submodule "zsh/p10k"]
path = zsh/p10k
url = https://github.com/romkatv/powerlevel10k.git
[submodule "nvim/pack/nvim/start/nvim-lspconfig"]
path = nvim/pack/nvim/start/nvim-lspconfig
url = https://github.com/neovim/nvim-lspconfig.git

View file

@ -94,29 +94,29 @@
[init]
defaultBranch = master
[pager]
diff = delta
log = delta
reflog = delta
show = delta
#[pager]
# diff = delta
# log = delta
# reflog = delta
# show = delta
[interactive]
diffFilter = delta --color-only --features=interactive
#[interactive]
# diffFilter = delta --color-only --features=interactive
[delta]
features = decorations
#[delta]
# features = decorations
[delta "interactive"]
keep-plus-minus-markers = false
#[delta "interactive"]
# keep-plus-minus-markers = false
[delta "decorations"]
commit-decoration-style = blue ol
commit-style = raw
file-style = omit
hunk-header-decoration-style = blue box
hunk-header-file-style = red
hunk-header-line-number-style = "#067a00"
hunk-header-style = file line-number syntax
#[delta "decorations"]
# commit-decoration-style = blue ol
# commit-style = raw
# file-style = omit
# hunk-header-decoration-style = blue box
# hunk-header-file-style = red
# hunk-header-line-number-style = "#067a00"
# hunk-header-style = file line-number syntax
[include]
path = .gitconfig.local

View file

@ -30,3 +30,5 @@ Thumbs.db
go.work
go.work.sum
__debug*

View file

@ -4,8 +4,10 @@ if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
end
vim.cmd [[packadd packer.nvim]]
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.cmd [[packadd packer.nvim]]
require 'options'
require 'keymaps'

View file

@ -1,10 +1,26 @@
local map = vim.api.nvim_set_keymap
local kmap = vim.keymap.set
local opts = {noremap = true, silent = true}
vim.g.mapleader = "\\"
map('n', '<Space>', '<Nop>', opts)
map('n', '<Home>', '^', opts)
map('n', '<End>', '$', opts)
map('v', '<Home>', '^', opts)
map('v', '<End>', '$', opts)
map('i', '<Home>', '<C-o>^', opts)
map('i', '<End>', '<C-o>$', opts)
map('v', 'i', '<S-i>', opts)
map('v', 'a', '<S-a>', opts)
-- Перемещение между буферами
kmap('n', '<leader>bn', ':bnext<CR>', { noremap = true, silent = true }) -- Следующий буфер
kmap('n', '<leader>bp', ':bprevious<CR>', { noremap = true, silent = true }) -- Предыдущий буфер
kmap('n', '<leader>bd', ':bdelete<CR>', { noremap = true, silent = true }) -- Закрыть текущий буфер
-- Tree
map('n', '<C-h>', ':NvimTreeToggle<CR>', opts)
map('n', '<C-t>', ':NvimTreeToggle<CR>', opts)
-- Telescope
map('n', '<leader>ff', '<cmd>Telescope find_files<CR>', opts)
@ -12,34 +28,28 @@ map('n', '<leader>fg', '<cmd>Telescope live_grep<CR>', opts)
map('n', '<leader>fb', '<cmd>Telescope buffers<CR>', opts)
-- LSP
-- map('n', '<leader>e', vim.diagnostic.open_float, opts)
-- map('n', '[d', vim.diagnostic.goto_prev, opts)
-- map('n', ']d', vim.diagnostic.goto_next, opts)
-- map('n', '<leader>q', vim.diagnostic.setloclist, opts)
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
local bufopts = { noremap=true, silent=true, buffer=bufnr }
kmap('n', '<leader>e', vim.diagnostic.open_float, opts)
kmap('n', '[d', vim.diagnostic.goto_prev, opts)
kmap('n', ']d', vim.diagnostic.goto_next, opts)
kmap('n', '<leader>q', vim.diagnostic.setloclist, opts)
-- стандартные горячие клавиши для LSP, больше в документации
-- https://github.com/neovim/nvim-lspconfig
map('n', 'gD', vim.lsp.buf.declaration, bufopts)
map('n', 'gd', vim.lsp.buf.definition, bufopts)
map('n', 'K', vim.lsp.buf.hover, bufopts)
map('n', 'gi', vim.lsp.buf.implementation, bufopts)
map('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
map('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
map('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
map('n', '<leader>wl', function()
kmap('n', 'gD', vim.lsp.buf.declaration, opts)
kmap('n', 'gd', vim.lsp.buf.definition, opts)
kmap('n', 'K', vim.lsp.buf.hover, opts)
kmap('n', 'gi', vim.lsp.buf.implementation, opts)
kmap('n', '<C-k>', vim.lsp.buf.signature_help, opts)
kmap('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
kmap('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
kmap('n', '<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
map('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
map('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
map('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
map('n', 'gr', vim.lsp.buf.references, bufopts)
map('n', '<leader>f', vim.lsp.buf.formatting, bufopts)
end
end, opts)
kmap('n', '<leader>D', vim.lsp.buf.type_definition, opts)
kmap('n', '<leader>rn', vim.lsp.buf.rename, opts)
kmap('n', '<leader>ca', vim.lsp.buf.code_action, opts)
kmap('n', 'gr', vim.lsp.buf.references, opts)
-- kmap('n', '<leader>f', vim.lsp.buf.formatting, opts)
local function change_root_to_global_cwd()
local api = require("nvim-tree.api")
@ -47,5 +57,5 @@ local function change_root_to_global_cwd()
api.tree.change_root(global_cwd)
end
vim.keymap.set('n', '<C-c>', change_root_to_global_cwd, {})
kmap('n', '<C-c>', change_root_to_global_cwd, {})

View file

@ -21,7 +21,6 @@ local options = {
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile
termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
updatetime = 300, -- faster completion (4000ms default)
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited

39
nvim/lua/plugins/cmp.lua Normal file
View file

@ -0,0 +1,39 @@
local cmp = require'cmp'
cmp.setup{
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
-- For `mini.snippets` users:
-- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert
-- insert({ body = args.body }) -- Insert at cursor
-- cmp.resubscribe({ "TextChangedI", "TextChangedP" })
-- require("cmp.config").set_onetime({ sources = {} })
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
}

View file

@ -2,41 +2,25 @@ return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'nvim-lua/plenary.nvim'
use 'neovim/nvim-lspconfig'
use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/cmp-buffer'
use 'hrsh7th/cmp-path'
use 'hrsh7th/nvim-cmp'
use {
'hrsh7th/nvim-cmp',
requires = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-vsnip',
'hrsh7th/vim-vsnip',
},
config = function()
require 'plugins.cmp'
end
}
use {
'nvim-lualine/lualine.nvim',
config = function()
require 'plugins.lualine'
end
}
-- движок сниппетов
use {
'L3MON4D3/LuaSnip',
after = 'friendly-snippets',
config = function()
require('luasnip/loaders/from_vscode').load({
paths = { '~/.local/share/nvim/site/pack/packer/start/friendly-snippets' }
})
end
}
-- автодополнения для сниппетов
use 'saadparwaiz1/cmp_luasnip'
-- набор готовых сниппетов для всех языков, включая go
use 'rafamadriz/friendly-snippets'
-- плагин для простого комментирования кода
use {
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
}
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate',
@ -50,12 +34,6 @@ return require('packer').startup(function(use)
require 'plugins.telescope'
end
}
use {
'olexsmir/gopher.nvim',
config = function()
-- require 'plugins.gopher'
end
}
use {
'nvim-tree/nvim-tree.lua',
config = function()

@ -0,0 +1 @@
Subproject commit 32b6a6449aaba11461fffbb596dd6310af79eea4

@ -0,0 +1 @@
Subproject commit ea0cc3c59f67c440c5ff0bbe4fb9420f4350b9a3

View file

@ -24,8 +24,12 @@ antigen apply
# Exports
#export GOPROXY=https://proxy.neonxp.ru
export GOPRIVATE=devopar.hippoparking.ru
export EDITOR="nvim"
#export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
export ANDROID_HOME=$HOME/projects/android/
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:~/.local/bin:~/go/bin
export GOBIN=~/go/bin
export GPG_TTY=$(tty)
@ -55,6 +59,7 @@ alias np="nano -w PKGBUILD"
alias gitu='git add . && git commit && git push'
alias g=git
alias nsh='wl-paste | curl -d @- https://nixshare.ru/upload 2>/dev/null | wl-copy'
alias p=python3
[[ ! -f `which exa` ]] || alias ls="exa" && alias ll="exa -l"