initial commit

This commit is contained in:
Јован Ђокић-Шумарац 2025-07-28 23:23:50 +02:00
commit e74fd4c1a5
6 changed files with 317 additions and 0 deletions

5
init.lua Normal file
View file

@ -0,0 +1,5 @@
require "plug"
require "colors"
require "options"
require "keymap"
require "lsp"

53
lua/colors.lua Normal file
View file

@ -0,0 +1,53 @@
local espresso = require('catppuccin')
local color_overrides = {
macchiato = {
rosewater = '#F5B8AB',
flamingo = '#F29D9D',
pink = '#AD6FF7',
mauve = '#FF8F40',
red = '#E66767',
maroon = '#EB788B',
peach = '#FAB770',
yellow = '#FACA64',
green = '#70CF67',
teal = '#4CD4BD',
sky = '#61BDFF',
sapphire = '#4BA8FA',
blue = '#00BFFF',
lavender = '#00BBCC',
text = '#C1C9E6',
subtext1 = '#A3AAC2',
subtext0 = '#8E94AB',
overlay2 = '#7D8296',
overlay1 = '#676B80',
overlay0 = '#464957',
surface2 = '#3A3D4A',
surface1 = '#2F313D',
surface0 = '#1D1E29',
base = '#0b0b0b',
mantle = '#11111a',
crust = '#191926',
},
}
local integrations = {
cmp = true,
gitsigns = true,
treesitter = true,
telescope = {
enabled = true,
style = 'nvchad',
},
mini = {
enabled = true,
},
}
espresso.setup({
flavour = 'macchiato',
color_overrides = color_overrides,
integrations = integrations,
})

41
lua/keymap.lua Normal file
View file

@ -0,0 +1,41 @@
-- Normal mode mappings
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.hover, { noremap = true })
vim.keymap.set('n', '<leader>tw', function() MiniTrailspace.trim() end, { noremap = true })
-- Terminal and buffer mappings
vim.keymap.set('n', '<leader>tt', '<cmd>terminal<CR>', { noremap = true })
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { noremap = true })
vim.keymap.set('n', '<C-Space>', '<cmd>bprev<CR>', { noremap = true })
-- Move selected text up/down in visual mode
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv", { noremap = true })
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv", { noremap = true })
-- Keep cursor in the middle when jumping or joining lines
vim.keymap.set('n', 'J', 'mzJ`z', { noremap = true })
vim.keymap.set('n', '<C-d>', '<C-d>zz', { noremap = true })
vim.keymap.set('n', '<C-u>', '<C-u>zz', { noremap = true })
vim.keymap.set('n', 'n', 'nzzzv', { noremap = true })
vim.keymap.set('n', 'N', 'Nzzzv', { noremap = true })
-- Interface with system clipboard in normal, visual, and select modes
vim.keymap.set({ 'n', 'v', 'x' }, '<leader>y', '\'+y', { noremap = true, silent = true })
vim.keymap.set({ 'n', 'v', 'x' }, '<leader>Y', '\'+yy', { noremap = true, silent = true })
vim.keymap.set({ 'n', 'v', 'x' }, '<leader>p', '\'+p', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>ff', ':Pick files<CR>')
vim.keymap.set('n', '<leader>fb', ':Pick buffers<CR>')
vim.keymap.set('n', '<leader>h', ':Pick help<CR>')
vim.keymap.set('n', '<leader>e', ':Oil<CR>')
vim.keymap.set('n', '<leader>lf', vim.lsp.buf.format)
vim.keymap.set('n', '<leader>o', ':update<CR> :source<CR>')
vim.keymap.set('n', '<leader>w', ':write<CR>')
vim.keymap.set('n', '<leader>q', ':quit<CR>')
vim.keymap.set({ 'n', 'v', 'x' }, '<leader>y', "'+y<CR>")
vim.keymap.set({ 'n', 'v', 'x' }, '<leader>d', "'+d<CR>")

98
lua/lsp.lua Normal file
View file

@ -0,0 +1,98 @@
local configs = require('nvim-treesitter.configs')
configs.setup({
ensure_installed = {
'c',
'bash',
'c_sharp',
'fennel',
'go',
'haskell',
'lua',
'python',
'query',
'rust',
'vim',
'vimdoc',
'hyprlang',
},
sync_install = false,
auto_install = true,
highlight = {
enable = true,
},
})
vim.filetype.add({
pattern = {
['.*/hypr/.*%.conf'] = 'hyprlang',
},
})
vim.filetype.add({
pattern = {
['*.tex'] = 'latex',
},
})
local mason = require("mason")
mason.setup()
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup({
ensure_installed = {
"fennel_ls",
"lua_ls",
"pylsp",
"ltex",
"zls",
"rust_analyzer",
},
automatic_installation = true,
})
-- vim.api.nvim_create_autocmd('LspAttach', {
-- callback = function(ev)
-- local client = vim.lsp.get_client_by_id(ev.data.client_id)
-- if client:supports_method('textDocument/completion') then
-- vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
-- end
-- end,
-- })
-- vim.cmd('set completeopt+=noselect')
--
require 'nvim-treesitter.configs'.setup({
ensure_installed = { 'lua' },
highlight = { enable = true }
})
vim.lsp.enable({ 'lua_ls' })
require "blink.cmp".setup({
keymap = {
preset = 'enter',
['<Shift-Tab>'] = { 'select_prev', 'fallback' },
['<Tab>'] = { 'select_next', 'fallback' },
-- disable a keymap from the preset
['<C-e>'] = false, -- or {}
-- show with a list of providers
['<C-s>'] = { function(cmp) cmp.show({ providers = { 'snippets' } }) end },
},
appearance = {
nerd_font_variant = 'normal'
},
completion = {
documentation = { auto_show = true }
},
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
},
fuzzy = {
implementation = "prefer_rust_with_warning"
},
})

44
lua/options.lua Normal file
View file

@ -0,0 +1,44 @@
vim.g.mapleader = ' '
vim.o.autoindent = true
vim.o.backup = false
vim.o.clipboard = 'unnamedplus'
-- vim.o.cmdheight = 0
vim.o.compatible = false
vim.o.cursorline = true
vim.o.expandtab = true
vim.o.hlsearch = true
vim.o.ignorecase = true
vim.o.inccommand = 'split'
vim.o.incsearch = true
vim.o.list = true
vim.o.mouse = 'a'
vim.o.mouse = 'v'
vim.o.number = true
vim.o.relativenumber = true
vim.o.shiftwidth = 4
vim.o.showmatch = true
vim.o.signcolumn = 'yes'
-- vim.o.signcolumn = 'yes:1'
vim.o.smartindent = true
vim.o.smarttab = false
vim.o.softtabstop = 4
vim.o.splitbelow = true
vim.o.splitkeep = 'screen'
vim.o.splitright = true
vim.o.startofline = false
vim.o.swapfile = false
vim.o.tabstop = 4
vim.o.termguicolors = true
vim.o.ttyfast = true
vim.o.undofile = true
vim.o.wildmode = 'longest,list'
vim.o.winborder = 'rounded'
vim.o.wrap = false
vim.o.background = 'dark'
vim.cmd.colorscheme('catppuccin')
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' })
vim.api.nvim_set_hl(0, 'FloatBorder', { bg = 'none' })
vim.api.nvim_set_hl(0, 'Pmenu', { bg = 'none' })

76
lua/plug.lua Normal file
View file

@ -0,0 +1,76 @@
vim.pack.add({
{ src = 'https://github.com/catppuccin/nvim' },
{ src = 'https://github.com/stevearc/oil.nvim' },
{ src = 'https://github.com/echasnovski/mini.pick' },
{ src = 'https://github.com/echasnovski/mini.cursorword' },
{ src = 'https://github.com/echasnovski/mini.starter' },
{ src = 'https://github.com/echasnovski/mini.trailspace' },
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter' },
{ src = 'https://github.com/neovim/nvim-lspconfig' },
{ src = 'https://github.com/echasnovski/mini.nvim' },
{ src = 'https://github.com/nvim-lualine/lualine.nvim' },
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' },
{ src = 'https://github.com/svampkorg/moody.nvim' },
{ src = 'https://github.com/svampkorg/moody.nvim' },
{ src = 'https://github.com/williamboman/mason.nvim' },
{ src = 'https://github.com/williamboman/mason-lspconfig.nvim' },
{ src = 'https://github.com/Saghen/blink.cmp', version = "v1.6.0" },
{ src = 'https://github.com/rafamadriz/friendly-snippets' }
})
-- vim.pack.update()
-- Conceal 'lambda' with 'λ'
vim.cmd([[syntax match keyword '\<lambda\>' conceal cchar=λ]])
vim.opt.conceallevel = 1
-- List of default plugins to disable
local default_plugins = {
'2html_plugin',
'getscript',
'getscriptPlugin',
'gzip',
'logipat',
'netrw',
'netrwPlugin',
'netrwSettings',
'netrwFileHandlers',
'matchit',
'tar',
'tarPlugin',
'rrhelper',
'spellfile_plugin',
'vimball',
'vimballPlugin',
'zip',
'zipPlugin',
'tutor',
'rplugin',
'syntax',
'synmenu',
'optwin',
'compiler',
'bugreport',
'ftplugin'
}
for _, plug in ipairs(default_plugins) do
vim.g['loaded_' .. plug] = 1
end
require 'mini.pick'.setup()
require 'mini.cursorword'.setup()
require 'mini.starter'.setup()
require 'mini.trailspace'.setup()
require 'moody'.setup()
require 'oil'.setup()
require('lualine').setup({
options = {
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
}
})