Skip to content

Commit e3a11a0

Browse files
author
Nurzhan Sarzhan
committed
first commit
1 parent 5bdde24 commit e3a11a0

27 files changed

+891
-953
lines changed

init.lua

Lines changed: 42 additions & 861 deletions
Large diffs are not rendered by default.
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
-- autopairs
2-
-- https://github.com/windwp/nvim-autopairs
3-
41
return {
52
'windwp/nvim-autopairs',
63
event = 'InsertEnter',

lua/custom/plugins/cmp.lua

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
return { -- Autocompletion
2+
'hrsh7th/nvim-cmp',
3+
event = 'InsertEnter',
4+
dependencies = {
5+
-- Snippet Engine & its associated nvim-cmp source
6+
{
7+
'L3MON4D3/LuaSnip',
8+
build = (function()
9+
-- Build Step is needed for regex support in snippets.
10+
-- This step is not supported in many windows environments.
11+
-- Remove the below condition to re-enable on windows.
12+
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
13+
return
14+
end
15+
return 'make install_jsregexp'
16+
end)(),
17+
dependencies = {
18+
-- `friendly-snippets` contains a variety of premade snippets.
19+
-- See the README about individual language/framework/plugin snippets:
20+
-- https://github.com/rafamadriz/friendly-snippets
21+
-- {
22+
-- 'rafamadriz/friendly-snippets',
23+
-- config = function()
24+
-- require('luasnip.loaders.from_vscode').lazy_load()
25+
-- end,
26+
-- },
27+
},
28+
},
29+
'saadparwaiz1/cmp_luasnip',
30+
31+
-- Adds other completion capabilities.
32+
-- nvim-cmp does not ship with all sources by default. They are split
33+
-- into multiple repos for maintenance purposes.
34+
'hrsh7th/cmp-nvim-lsp',
35+
'hrsh7th/cmp-path',
36+
},
37+
config = function()
38+
-- See `:help cmp`
39+
local cmp = require 'cmp'
40+
local luasnip = require 'luasnip'
41+
luasnip.config.setup {}
42+
43+
cmp.setup {
44+
snippet = {
45+
expand = function(args)
46+
luasnip.lsp_expand(args.body)
47+
end,
48+
},
49+
completion = { completeopt = 'menu,menuone,noinsert' },
50+
51+
-- For an understanding of why these mappings were
52+
-- chosen, you will need to read `:help ins-completion`
53+
--
54+
-- No, but seriously. Please read `:help ins-completion`, it is really good!
55+
mapping = cmp.mapping.preset.insert {
56+
-- Select the [n]ext item
57+
-- ['<C-n>'] = cmp.mapping.select_next_item(),
58+
-- Select the [p]revious item
59+
-- ['<C-p>'] = cmp.mapping.select_prev_item(),
60+
61+
-- Scroll the documentation window [b]ack / [f]orward
62+
['<C-b>'] = cmp.mapping.scroll_docs(-4),
63+
['<C-f>'] = cmp.mapping.scroll_docs(4),
64+
65+
-- Accept ([y]es) the completion.
66+
-- This will auto-import if your LSP supports it.
67+
-- This will expand snippets if the LSP sent a snippet.
68+
-- ['<C-y>'] = cmp.mapping.confirm { select = true },
69+
70+
-- If you prefer more traditional completion keymaps,
71+
-- you can uncomment the following lines
72+
['<CR>'] = cmp.mapping.confirm { select = true },
73+
['<Tab>'] = cmp.mapping.select_next_item(),
74+
['<S-Tab>'] = cmp.mapping.select_prev_item(),
75+
76+
-- Manually trigger a completion from nvim-cmp.
77+
-- Generally you don't need this, because nvim-cmp will display
78+
-- completions whenever it has completion options available.
79+
['<C-Space>'] = cmp.mapping.complete {},
80+
81+
-- Think of <c-l> as moving to the right of your snippet expansion.
82+
-- So if you have a snippet that's like:
83+
-- function $name($args)
84+
-- $body
85+
-- end
86+
--
87+
-- <c-l> will move you to the right of each of the expansion locations.
88+
-- <c-h> is similar, except moving you backwards.
89+
['<C-l>'] = cmp.mapping(function()
90+
if luasnip.expand_or_locally_jumpable() then
91+
luasnip.expand_or_jump()
92+
end
93+
end, { 'i', 's' }),
94+
['<C-h>'] = cmp.mapping(function()
95+
if luasnip.locally_jumpable(-1) then
96+
luasnip.jump(-1)
97+
end
98+
end, { 'i', 's' }),
99+
100+
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
101+
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
102+
},
103+
sources = {
104+
{
105+
name = 'lazydev',
106+
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
107+
group_index = 0,
108+
},
109+
{ name = 'nvim_lsp' },
110+
{ name = 'luasnip' },
111+
{ name = 'path' },
112+
},
113+
}
114+
end,
115+
}

lua/custom/plugins/conform.lua

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
return { -- Autoformat
2+
'stevearc/conform.nvim',
3+
event = { 'BufWritePre' },
4+
cmd = { 'ConformInfo' },
5+
keys = {
6+
{
7+
'<leader>f',
8+
function()
9+
require('conform').format { async = true, lsp_format = 'fallback' }
10+
end,
11+
mode = '',
12+
desc = '[F]ormat buffer',
13+
},
14+
},
15+
opts = {
16+
notify_on_error = false,
17+
format_on_save = function(bufnr)
18+
-- Disable "format_on_save lsp_fallback" for languages that don't
19+
-- have a well standardized coding style. You can add additional
20+
-- languages here or re-enable it for the disabled ones.
21+
local disable_filetypes = { c = true, cpp = true }
22+
local lsp_format_opt
23+
if disable_filetypes[vim.bo[bufnr].filetype] then
24+
lsp_format_opt = 'never'
25+
else
26+
lsp_format_opt = 'fallback'
27+
end
28+
return {
29+
timeout_ms = 500,
30+
lsp_format = lsp_format_opt,
31+
}
32+
end,
33+
formatters_by_ft = {
34+
lua = { 'stylua' },
35+
-- Conform can also run multiple formatters sequentially
36+
python = { 'isort', 'black' },
37+
--
38+
-- You can use 'stop_after_first' to run the first available formatter from the list
39+
javascript = { 'prettierd', 'prettier', stop_after_first = true },
40+
},
41+
},
42+
}
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
-- debug.lua
2-
--
3-
-- Shows how to use the DAP plugin to debug your code.
4-
--
5-
-- Primarily focused on configuring the debugger for Go, but can
6-
-- be extended to other languages as well. That's why it's called
7-
-- kickstart.nvim and not kitchen-sink.nvim ;)
8-
91
return {
102
-- NOTE: Yes, you can install new plugins here!
113
'mfussenegger/nvim-dap',
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
-- Adds git related signs to the gutter, as well as utilities for managing changes
2-
-- NOTE: gitsigns is already included in init.lua but contains only the base
3-
-- config. This will add also the recommended keymaps.
4-
51
return {
62
{
73
'lewis6991/gitsigns.nvim',

lua/custom/plugins/gruvbox.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
return { -- You can easily change to a different colorscheme.
2+
-- Change the name of the colorscheme plugin below, and then
3+
-- change the command in the config to whatever the name of that colorscheme is.
4+
--
5+
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
6+
'ellisonleao/gruvbox.nvim',
7+
priority = 1000, -- Make sure to load this before all the other start plugins.
8+
opts = {
9+
transparent_mode = true,
10+
},
11+
config = function()
12+
vim.o.background = 'dark' -- or "light" for light mode
13+
vim.cmd [[colorscheme gruvbox]]
14+
end,
15+
}

lua/custom/plugins/illuminate.lua

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
return {
2+
'RRethy/vim-illuminate',
3+
event = 'VeryLazy',
4+
config = function()
5+
require('illuminate').configure {
6+
providers = {
7+
'lsp',
8+
'treesitter',
9+
'regex',
10+
},
11+
delay = 100,
12+
filetype_overrides = {},
13+
filetypes_denylist = {
14+
'dirbuf',
15+
'dirvish',
16+
'fugitive',
17+
},
18+
filetypes_allowlist = {},
19+
modes_denylist = {},
20+
modes_allowlist = {},
21+
providers_regex_syntax_denylist = {},
22+
providers_regex_syntax_allowlist = {},
23+
under_cursor = true,
24+
large_file_cutoff = nil,
25+
large_file_overrides = nil,
26+
min_count_to_highlight = 1,
27+
should_enable = function(_)
28+
return true
29+
end,
30+
case_insensitive_regex = false,
31+
}
32+
end,
33+
}

lua/custom/plugins/indent_line.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
'lukas-reineke/indent-blankline.nvim',
3+
-- Enable `lukas-reineke/indent-blankline.nvim`
4+
-- See `:help ibl`
5+
main = 'ibl',
6+
opts = {},
7+
}

0 commit comments

Comments
 (0)