From 0f024abb5200ee0e6c96320cadeaba446682cb85 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 30 Mar 2023 22:54:32 +0400 Subject: Переработал структуру настроек и плагинов MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Valentin Popov --- init.vim | 14 -------------- lua/init.lua | 4 +--- lua/plugins.lua | 44 +++++++++++++++++++++++++++++++++++--------- lua/plugins/comment.lua | 1 - lua/plugins/lualine.lua | 10 ---------- lua/plugins/treesitter.lua | 1 - lua/settings.lua | 16 ++++++++++++++++ 7 files changed, 52 insertions(+), 38 deletions(-) delete mode 100644 lua/plugins/comment.lua delete mode 100644 lua/plugins/lualine.lua delete mode 100644 lua/plugins/treesitter.lua create mode 100644 lua/settings.lua diff --git a/init.vim b/init.vim index bae78f9..88344de 100644 --- a/init.vim +++ b/init.vim @@ -6,19 +6,5 @@ augroup packer_user_config autocmd BufWritePost plugins.lua source | PackerCompile augroup end -" Setting up the theme -colorscheme carbonfox -set cursorline - " Automatic file trimming when saving autocmd BufWritePre * :%s/\s\+$//e - -" Enable line number display -set number -set relativenumber - -" Setting up indents -set autoindent -set expandtab -set tabstop=4 -set shiftwidth=4 diff --git a/lua/init.lua b/lua/init.lua index b3e80c5..92429ce 100644 --- a/lua/init.lua +++ b/lua/init.lua @@ -1,4 +1,2 @@ require('plugins') -require('plugins/comment') -require('plugins/lualine') -require('plugins/treesitter') +require('settings') diff --git a/lua/plugins.lua b/lua/plugins.lua index f306c12..385ed3e 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,16 +1,42 @@ --- This file can be loaded by calling `lua require('plugins')` from your init.vim - --- Only required if you have packer configured as `opt` -vim.cmd [[packadd packer.nvim]] +vim.cmd.packadd('packer.nvim') return require('packer').startup(function(use) - use { 'wbthomason/packer.nvim', opt = true } + -- Авто-установка пакетного менеджера + use 'wbthomason/packer.nvim' - use { 'EdenEast/nightfox.nvim' } + -- Тема редактора + use { + 'EdenEast/nightfox.nvim', + config = function() + vim.cmd('colorscheme carbonfox') + end, + } - use { 'nvim-lualine/lualine.nvim' } + -- Статусная полоса + use { + 'nvim-lualine/lualine.nvim', + config = function() + require('lualine').setup { + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff' }, + lualine_c = { 'filename' }, + lualine_x = { 'encoding', 'filetype', 'filesize' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' }, + } + } + end, + } - use { 'numToStr/Comment.nvim' } + -- Комментирование строк + use { + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup() + end, + } - use { 'nvim-treesitter/nvim-treesitter' } + -- Расширенная подсветка синтаксиса + use 'nvim-treesitter/nvim-treesitter' end) diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua deleted file mode 100644 index 933d7b7..0000000 --- a/lua/plugins/comment.lua +++ /dev/null @@ -1 +0,0 @@ -require('Comment').setup {} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua deleted file mode 100644 index 39ed92f..0000000 --- a/lua/plugins/lualine.lua +++ /dev/null @@ -1,10 +0,0 @@ -require('lualine').setup { - sections = { - lualine_a = { 'mode' }, - lualine_b = { 'branch', 'diff' }, - lualine_c = { 'filename' }, - lualine_x = { 'encoding', 'filetype', 'filesize' }, - lualine_y = { 'progress' }, - lualine_z = { 'location' }, - } -} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua deleted file mode 100644 index 003dbb9..0000000 --- a/lua/plugins/treesitter.lua +++ /dev/null @@ -1 +0,0 @@ -require('nvim-treesitter').setup {} diff --git a/lua/settings.lua b/lua/settings.lua new file mode 100644 index 0000000..d3b4b22 --- /dev/null +++ b/lua/settings.lua @@ -0,0 +1,16 @@ +local opt = vim.opt + +-- Общие настройки +opt.swapfile = false -- Отключение SWAP файлов + +-- Настройка внешнего вида +opt.cursorline = true -- Подсветка текущей строки + +-- Настройка отступов +opt.expandtab = true -- Замена на пробелы +opt.shiftwidth = 4 -- Размер отступа в пробелах +opt.tabstop = 4 -- Размер в пробелах + +-- Настройка номеров строк +opt.number = true -- Отображать номер текущей строки +opt.relativenumber = true -- Использовать относительные номера строк \ No newline at end of file -- cgit v1.2.3