Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream Sync #24

Closed
wants to merge 9 commits into from
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fork to your machine using one of the commands below, depending on your OS.

> **NOTE**
> Your fork's url will be something like this:
> `https://github.com/<your_github_username>/kickstart-modular.nvim.git`
> `https://github.com/ScilentAssasin/kickstart-modular.nvim.git`

#### Clone kickstart.nvim
> **NOTE**
Expand All @@ -68,7 +68,7 @@ fork to your machine using one of the commands below, depending on your OS.
<details><summary> Linux and Mac </summary>

```sh
git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
git clone https://github.com/ScilentAssasin/kickstart-modular.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
```

</details>
Expand Down
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true

-- [[ Setting options ]]
require 'options'
Expand Down
17 changes: 17 additions & 0 deletions lua/custom/plugins/autopairs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- File: lua/custom/plugins/autopairs.lua

return {
"windwp/nvim-autopairs",
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require("nvim-autopairs").setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end,
}
40 changes: 40 additions & 0 deletions lua/custom/plugins/competitest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
return {
'xeluxee/competitest.nvim',
dependencies = 'MunifTanjim/nui.nvim',
config = function()
require('competitest').setup {
cpp = {
exec = 'g++',
args = {
'-std=c++17',
'-g',
'$(FNAME)',
'-o',
'$(FNOEXT)',
},
},
template_file = {
cpp = '~/Coding/code-compitative/c++/template.cpp',
},
save_current_file = true,
view_output_diff = true,
evaluate_template_modifiers = true,
received_problems_path = '$(CWD)/$(GROUP)/$(PROBLEM).$(FEXT)',
received_contests_directory = '$(CWD)/$(GROUP)',
testcases_directory = './tests',
layout = {
{ 1, {
{ 1, 'so' },
{ 1, {
{ 1, 'tc' },
{ 1, 'se' },
} },
} },
{ 1, {
{ 1, 'eo' },
{ 1, 'si' },
} },
},
}
end,
}
13 changes: 13 additions & 0 deletions lua/custom/plugins/statusline.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = '|',
section_separators = '',
},
},
}
5 changes: 5 additions & 0 deletions lua/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ vim.api.nvim_create_autocmd('TextYankPost', {
end,
})

-- set tabs size for c, c++ files
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = { '*.c', '*.cpp', '*.h' },
command = 'setlocal autoindent expandtab tabstop=2 shiftwidth=2',
})
-- vim: ts=2 sts=2 sw=2 et
12 changes: 6 additions & 6 deletions lua/kickstart/plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ return {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
-- {
-- 'rafamadriz/friendly-snippets',
-- config = function()
-- require('luasnip.loaders.from_vscode').lazy_load()
-- end,
-- },
{
'rafamadriz/friendly-snippets',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
},
},
'saadparwaiz1/cmp_luasnip',
Expand Down
2 changes: 1 addition & 1 deletion lua/kickstart/plugins/conform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ return {
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
local disable_filetypes = { c = true, cpp = false }
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
Expand Down
21 changes: 18 additions & 3 deletions lua/kickstart/plugins/debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ return {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',

-- Shows Virtual Text while debugging
'theHamsta/nvim-dap-virtual-text',

-- Required dependency for nvim-dap-ui
'nvim-neotest/nvim-nio',

Expand All @@ -22,7 +25,9 @@ return {
'jay-babu/mason-nvim-dap.nvim',

-- Add your own debuggers here
'leoluz/nvim-dap-go',
-- 'leoluz/nvim-dap-go',
'mfussenegger/nvim-dap-python',
'microsoft/vscode-cpptools',
},
config = function()
local dap = require 'dap'
Expand All @@ -41,10 +46,14 @@ return {
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
'delve',
--'delve',
'cpptools',
'debugpy',
},
}

require('nvim-dap-virtual-text').setup()

-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' })
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' })
Expand Down Expand Up @@ -85,6 +94,12 @@ return {
dap.listeners.before.event_exited['dapui_config'] = dapui.close

-- Install golang specific config
require('dap-go').setup()
-- require('dap-go').setup()
local cppdbg_path = '/home/scilent/.local/share/nvim/mason/bin/OpenDebugAD7'
dap.adapters.cppdbg = {
id = 'cppdbg',
type = 'executable',
command = cppdbg_path,
}
end,
}
15 changes: 14 additions & 1 deletion lua/kickstart/plugins/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ return {
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
dependencies = {
'nvim-treesitter/nvim-treesitter-context',
'nvim-treesitter/nvim-treesitter-textobjects',
},
opts = {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
ensure_installed = { 'bash', 'cpp', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'javascript', 'css', 'rust' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
Expand All @@ -14,6 +18,15 @@ return {
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
incremental_selection = {
enable = true,
keymaps = {
init_selection = 'gnn',
node_incremental = 'grn',
scope_incremental = 'grc',
node_decremental = 'grm',
},
},
},
config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
Expand Down
17 changes: 11 additions & 6 deletions lua/lazy-plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
-- NOTE: Here is where you install your plugins.
require('lazy').setup({
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).

-- Git related plugins
'tpope/vim-fugitive',
'tpope/vim-rhubarb',

'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically

-- NOTE: Plugins can also be added by using a table,
Expand Down Expand Up @@ -57,18 +62,18 @@ require('lazy').setup({
-- Here are some example plugins that I've included in the Kickstart repository.
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
require 'kickstart.plugins.debug',
require 'kickstart.plugins.indent_line',
require 'kickstart.plugins.lint',
require 'kickstart.plugins.autopairs',
require 'kickstart.plugins.neo-tree',

-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
}, {
ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the
Expand Down
13 changes: 12 additions & 1 deletion lua/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@
vim.opt.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
vim.opt.relativenumber = true

-- AutoCommand to toggle number
vim.api.nvim_create_autocmd({ 'BufEnter', 'FocusGained', 'InsertLeave', 'WinEnter' }, {
pattern = { '*' },
command = "if &nu && mode() != 'i' | set rnu | endif",
})

vim.api.nvim_create_autocmd({ 'BufLeave', 'FocusLost', 'InsertEnter', 'WinLeave' }, {
pattern = { '*' },
command = 'if &nu | set nornu | endif',
})

-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
Expand Down