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"] [submodule "zsh/p10k"]
path = zsh/p10k path = zsh/p10k
url = https://github.com/romkatv/powerlevel10k.git 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] [init]
defaultBranch = master defaultBranch = master
[pager] #[pager]
diff = delta # diff = delta
log = delta # log = delta
reflog = delta # reflog = delta
show = delta # show = delta
[interactive] #[interactive]
diffFilter = delta --color-only --features=interactive # diffFilter = delta --color-only --features=interactive
[delta] #[delta]
features = decorations # features = decorations
[delta "interactive"] #[delta "interactive"]
keep-plus-minus-markers = false # keep-plus-minus-markers = false
[delta "decorations"] #[delta "decorations"]
commit-decoration-style = blue ol # commit-decoration-style = blue ol
commit-style = raw # commit-style = raw
file-style = omit # file-style = omit
hunk-header-decoration-style = blue box # hunk-header-decoration-style = blue box
hunk-header-file-style = red # hunk-header-file-style = red
hunk-header-line-number-style = "#067a00" # hunk-header-line-number-style = "#067a00"
hunk-header-style = file line-number syntax # hunk-header-style = file line-number syntax
[include] [include]
path = .gitconfig.local path = .gitconfig.local

View file

@ -30,3 +30,5 @@ Thumbs.db
go.work go.work
go.work.sum 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}) packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
end end
vim.cmd [[packadd packer.nvim]] vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.cmd [[packadd packer.nvim]]
require 'options' require 'options'
require 'keymaps' require 'keymaps'

View file

@ -1,10 +1,26 @@
local map = vim.api.nvim_set_keymap local map = vim.api.nvim_set_keymap
local kmap = vim.keymap.set
local opts = {noremap = true, silent = true} 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 -- Tree
map('n', '<C-h>', ':NvimTreeToggle<CR>', opts) map('n', '<C-t>', ':NvimTreeToggle<CR>', opts)
-- Telescope -- Telescope
map('n', '<leader>ff', '<cmd>Telescope find_files<CR>', opts) 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) map('n', '<leader>fb', '<cmd>Telescope buffers<CR>', opts)
-- LSP -- LSP
-- map('n', '<leader>e', vim.diagnostic.open_float, opts) kmap('n', '<leader>e', vim.diagnostic.open_float, opts)
-- map('n', '[d', vim.diagnostic.goto_prev, opts) kmap('n', '[d', vim.diagnostic.goto_prev, opts)
-- map('n', ']d', vim.diagnostic.goto_next, opts) kmap('n', ']d', vim.diagnostic.goto_next, opts)
-- map('n', '<leader>q', vim.diagnostic.setloclist, opts) kmap('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 }
-- стандартные горячие клавиши для LSP, больше в документации -- стандартные горячие клавиши для LSP, больше в документации
-- https://github.com/neovim/nvim-lspconfig -- https://github.com/neovim/nvim-lspconfig
map('n', 'gD', vim.lsp.buf.declaration, bufopts) kmap('n', 'gD', vim.lsp.buf.declaration, opts)
map('n', 'gd', vim.lsp.buf.definition, bufopts) kmap('n', 'gd', vim.lsp.buf.definition, opts)
map('n', 'K', vim.lsp.buf.hover, bufopts) kmap('n', 'K', vim.lsp.buf.hover, opts)
map('n', 'gi', vim.lsp.buf.implementation, bufopts) kmap('n', 'gi', vim.lsp.buf.implementation, opts)
map('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) kmap('n', '<C-k>', vim.lsp.buf.signature_help, opts)
map('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts) kmap('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
map('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts) kmap('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
map('n', '<leader>wl', function() kmap('n', '<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts) end, opts)
map('n', '<leader>D', vim.lsp.buf.type_definition, bufopts) kmap('n', '<leader>D', vim.lsp.buf.type_definition, opts)
map('n', '<leader>rn', vim.lsp.buf.rename, bufopts) kmap('n', '<leader>rn', vim.lsp.buf.rename, opts)
map('n', '<leader>ca', vim.lsp.buf.code_action, bufopts) kmap('n', '<leader>ca', vim.lsp.buf.code_action, opts)
map('n', 'gr', vim.lsp.buf.references, bufopts) kmap('n', 'gr', vim.lsp.buf.references, opts)
map('n', '<leader>f', vim.lsp.buf.formatting, bufopts) -- kmap('n', '<leader>f', vim.lsp.buf.formatting, opts)
end
local function change_root_to_global_cwd() local function change_root_to_global_cwd()
local api = require("nvim-tree.api") local api = require("nvim-tree.api")
@ -47,5 +57,5 @@ local function change_root_to_global_cwd()
api.tree.change_root(global_cwd) api.tree.change_root(global_cwd)
end 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 splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile swapfile = false, -- creates a swapfile
termguicolors = true, -- set term gui colors (most terminals support this) 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 undofile = true, -- enable persistent undo
updatetime = 300, -- faster completion (4000ms default) 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 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 'wbthomason/packer.nvim'
use 'nvim-lua/plenary.nvim' use 'nvim-lua/plenary.nvim'
use 'neovim/nvim-lspconfig' use 'neovim/nvim-lspconfig'
use 'hrsh7th/cmp-nvim-lsp' use {
use 'hrsh7th/cmp-buffer' 'hrsh7th/nvim-cmp',
use 'hrsh7th/cmp-path' requires = {
use 'hrsh7th/nvim-cmp' 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-vsnip',
'hrsh7th/vim-vsnip',
},
config = function()
require 'plugins.cmp'
end
}
use { use {
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
config = function() config = function()
require 'plugins.lualine' require 'plugins.lualine'
end 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 { use {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate', run = ':TSUpdate',
@ -50,12 +34,6 @@ return require('packer').startup(function(use)
require 'plugins.telescope' require 'plugins.telescope'
end end
} }
use {
'olexsmir/gopher.nvim',
config = function()
-- require 'plugins.gopher'
end
}
use { use {
'nvim-tree/nvim-tree.lua', 'nvim-tree/nvim-tree.lua',
config = function() config = function()

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

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

View file

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