diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2025-01-08 00:20:29 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2025-01-08 00:20:29 +0400 |
commit | 0ab33c984e73af41133135e1e19e482ce39b1335 (patch) | |
tree | 54a1888e3bf1b0462d87f2cd679df4e846045a89 | |
parent | 609bc970264cfbb7ab24f79cd1c36fec8e77ea01 (diff) |
nvim: plugins added
-rw-r--r-- | config/nvim/init.lua | 26 | ||||
-rw-r--r-- | config/nvim/lua/plugins.lua | 93 |
2 files changed, 95 insertions, 24 deletions
diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 75ed831..cd0d2de 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -1,3 +1,5 @@ +require "plugins" + vim.cmd("let mapleader = ' '") vim.cmd("set relativenumber") vim.cmd("set number") @@ -31,27 +33,3 @@ vim.keymap.set('n', 'L',':wincmd l<CR>') vim.keymap.set('i','<C-h>','<Left>') vim.keymap.set('i','<C-l>','<Right>') vim.keymap.set('i','<C-space>','<ESC>') - -local ensure_packer = function() - local fn = vim.fn - local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' - if fn.empty(fn.glob(install_path)) > 0 then - fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) - vim.cmd [[packadd packer.nvim]] - return true - end - return false -end - -local packer_bootstrap = ensure_packer() - -return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - use 'EdenEast/nightfox.nvim' - - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if packer_bootstrap then - require('packer').sync() - end -end) diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua new file mode 100644 index 0000000..f8d0d03 --- /dev/null +++ b/config/nvim/lua/plugins.lua @@ -0,0 +1,93 @@ +require('Comment').setup{ + padding = true, -- Add a space b/w comment and the line + sticky = true, -- Whether the cursor should stay at its position + ignore = nil, -- Lines to be ignored while (un)comment + -- LHS of toggle mappings in NORMAL mode + toggler = { + line = 'cc', --Line-comment toggle keymap + block = 'cb', -- Block-comment toggle keymap + }, + -- LHS of operator-pending mappings in NORMAL and VISUAL mode + opleader = { + line = 'cc', --Line-comment keymap + block = 'cb', --Block-comment keymap + }, +} + +require("toggleterm").setup{ + size = 10, + open_mapping = [[<c-f>]], + hide_numbers = true, + shade_terminals = true, + direction = "float", + float_opts = { + -- border = 'curved', + winblend = 0, --transparency + } + +} + +require("neo-tree").setup({ + filesystem = { + window = { + mappings = { + ["l"] = "open", + ["h"] = "close_node", + ["zh"] = "toggle_hidden", + ["H"] = "close_all_nodes", + } + } + }, + --Indent Markers + default_component_configs = { + indent = { + with_markers = true, + indent_marker = "│", + last_indent_marker = "└", + indent_size = 2, + }, + }, + --Expanders + default_component_configs = { + indent = { + with_expanders = false, --Not active + expander_collapsed = ">", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + }, + +}) + +require('nvim-autopairs').setup({ + disable_filetype = { "TelescopePrompt", "spectre_panel", "neo-tree-popup", "conf"}, + disable_in_macro = true, + disable_in_visualblock = false, + disable_in_replace_mode = true, +}) + +--[[ PACKER BOOTSTRAP ]] +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + +return require('packer').startup(function(use) + use 'wbthomason/packer.nvim' + use "akinsho/toggleterm.nvim" + use 'numToStr/Comment.nvim' + use 'windwp/nvim-autopairs' + use 'EdenEast/nightfox.nvim' + + if packer_bootstrap then + require('packer').sync() + end +end) |