📦 Initial Commit

This commit is contained in:
UnknownRori 2023-06-12 09:28:01 +07:00
parent 5125fd927a
commit e77acb091e
No known key found for this signature in database
GPG key ID: 25FB6BA9E0169742
23 changed files with 516 additions and 24 deletions

View file

@ -63,6 +63,7 @@ vim.opt.rtp:prepend(lazypath)
-- You can also configure plugins after the setup call,
-- as they will be available in your neovim runtime.
require('lazy').setup({
-- NOTE: First, some plugins that don't require any configuration
-- Git related plugins
@ -72,6 +73,8 @@ require('lazy').setup({
-- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth',
require('custom.plugins.inlayhint'),
-- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below.
{
@ -84,7 +87,7 @@ require('lazy').setup({
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },
{ 'j-hui/fidget.nvim', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
@ -108,7 +111,7 @@ require('lazy').setup({
},
-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
@ -122,21 +125,14 @@ require('lazy').setup({
changedelete = { text = '~' },
},
on_attach = function(bufnr)
vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' })
vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' })
vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
end,
},
},
{
-- Theme inspired by Atom
'navarasu/onedark.nvim',
priority = 1000,
config = function()
vim.cmd.colorscheme 'onedark'
end,
},
require('custom.theme'),
{
-- Set lualine as statusline
@ -144,10 +140,27 @@ require('lazy').setup({
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = false,
theme = 'onedark',
component_separators = '|',
section_separators = '',
icons_enabled = true,
theme = 'auto',
section_separators = { left = "", right = "" },
component_separators = { left = "", right = "" }
},
-- Custom sections
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = { 'filename' },
lualine_x = { 'encoding', 'filetype', require('custom.lualine').me },
lualine_y = { 'progress' },
lualine_z = { 'location' }
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { 'filename' },
lualine_x = {},
lualine_y = { 'encoding', 'filetype', require('custom.lualine').me },
lualine_z = { 'location' }
},
},
},
@ -164,7 +177,7 @@ require('lazy').setup({
},
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
{ 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc)
{ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
@ -272,11 +285,15 @@ vim.api.nvim_create_autocmd('TextYankPost', {
-- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup {
defaults = {
winblend = 50,
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
["<C-n>"] = require('telescope.actions').cycle_history_next,
["<C-p>"] = require('telescope.actions').cycle_history_prev,
["<C-j>"] = require('telescope.actions').move_selection_next,
["<C-k>"] = require('telescope.actions').move_selection_previous,
},
n = { q = require('telescope.actions').close },
},
},
}
@ -306,10 +323,10 @@ vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { de
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' },
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'php' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
@ -477,8 +494,10 @@ cmp.setup {
end,
},
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-j>'] = cmp.mapping.select_next_item(),
['<C-k>'] = cmp.mapping.select_prev_item(),
-- ['<C-n>'] = cmp.mapping.select_next_item(),
-- ['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
@ -513,3 +532,8 @@ cmp.setup {
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
-- Custom stuff
require('custom.core')