Separated lua config to init.lua

This commit is contained in:
Јован Ђокић-Шумарац 2023-07-27 17:20:40 +02:00
parent 31faef71c2
commit d3e868c115
2 changed files with 185 additions and 102 deletions

119
init.vim
View file

@ -24,12 +24,13 @@ set showmatch
set hlsearch
set incsearch
set tabstop=16
set softtabstop=4
set shiftwidth=4
set autoindent
set number relativenumber
set wildmode=longest,list
set cc=80
" set cc=80
@ -104,10 +105,18 @@ call plug#begin()
Plug 'folke/twilight.nvim'
Plug 'folke/zen-mode.nvim'
Plug 'preservim/nerdtree'
Plug 'tamton-aquib/staline.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.2' }
Plug 'nvim-telescope/telescope-file-browser.nvim'
Plug 'willothy/veil.nvim'
Plug 'chentoast/marks.nvim'
call plug#end()
lua require('init')
@ -154,13 +163,16 @@ colorscheme onedark
" | \ |___ | |__) | | \| |__/ .__/
let mapleader=" "
nnoremap <leader>tw <cmd>lua MiniTrailspace.trim()<CR>
nnoremap <leader>ff <cmd>lua MiniFiles.open()<CR>
nnoremap <leader>fc <cmd>lua MiniFiles.close()<CR>
nnoremap <leader>ff <cmd>Telescope find_files<CR>
nnoremap <leader>fm <cmd>NERDTree<CR>
nnoremap <leader>fc <cmd>NERDTreeClose<CR>
nnoremap <leader>tt <cmd>12 split <CR><cmd>Tnew<CR>
" nnoremap <leader>sc <cmd>TSEnable highlight<CR>
nnoremap <leader>sc <cmd>TSEnable highlight<CR>
nnoremap <leader>zt <cmd>Twilight<CR>
nnoremap <leader>zz <cmd>ZenMode<CR>
@ -183,100 +195,3 @@ sunmap ge
" inevitable.....
" | | | /\
" |___ \__/ /~~\
lua << EOF
require('colorizer').setup()
require('mini.completion').setup()
require('mini.cursorword').setup()
require('mini.files').setup()
require('mini.pairs').setup()
require('mini.starter').setup()
require('mini.trailspace').setup()
require('mini.statusline').setup()
require('mini.hipatterns').setup()
require('mini.indentscope').setup()
require('noice').setup()
-- require('mason').setup()
require('nvim-treesitter.configs').setup {
rainbow = {
enable = true,
-- list of languages you want to disable the plugin for
disable = { 'jsx' },
-- Which query to use for finding delimiters
query = 'rainbow-parens',
-- Highlight the entire buffer all at once
strategy = require('ts-rainbow').strategy.global,
}
}
require('neorg').setup {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.concealer"] = {}, -- Adds pretty icons to your documents
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/notes",
},
},
},
},
}
require('smoothcursor').setup({
autostart = true,
cursor = "", -- cursor shape (need nerd font)
texthl = "SmoothCursor", -- highlight group, default is { bg = nil, fg = "#FFD400" }
linehl = nil, -- highlight sub-cursor line like 'cursorline', "CursorLine" recommended
type = "default", -- define cursor movement calculate function, "default" or "exp" (exponential).
fancy = {
enable = true, -- enable fancy mode
head = { cursor = "", texthl = "SmoothCursor", linehl = nil },
body = {
{ cursor = "", texthl = "SmoothCursorYellow" },
{ cursor = "", texthl = "SmoothCursorYellow" },
{ cursor = "●", texthl = "SmoothCursorYellow" },
{ cursor = "●", texthl = "SmoothCursorYellow" },
{ cursor = "•", texthl = "SmoothCursorYellow" },
{ cursor = ".", texthl = "SmoothCursorYellow" },
{ cursor = ".", texthl = "SmoothCursorYellow" },
},
tail = { cursor = nil, texthl = "SmoothCursor" }
},
flyin_effect = nil, -- "bottom" or "top"
speed = 50, -- max is 100 to stick to your current position
intervals = 25, -- tick interval
priority = 10, -- set marker priority
timeout = 1500, -- timout for animation
threshold = 3, -- animate if threshold lines jump
disable_float_win = false, -- disable on float window
enabled_filetypes = nil, -- example: { "lua", "vim" }
disabled_filetypes = nil, -- this option will be skipped if enabled_filetypes is set. example: { "TelescopePrompt", "NvimTree" }
})
EOF

168
lua/init.lua Normal file
View file

@ -0,0 +1,168 @@
--
-- | | | /\
-- |___ \__/ /~~\
require('colorizer').setup()
require('mini.completion').setup()
require('mini.cursorword').setup()
require('mini.pairs').setup()
require('mini.trailspace').setup()
require('mini.hipatterns').setup()
require('mini.indentscope').setup()
require('noice').setup()
require('veil').setup()
-- require('mason').setup()
-- require('mini.files').setup()
-- require('mini.statusline').setup()
-- require('mini.starter').setup()
vim.opt.laststatus=2
vim.keymap.set('i', '<Tab>', [[pumvisible() ? "\<C-n>" : "\<Tab>"]], { expr = true })
vim.keymap.set('i', '<S-Tab>', [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]], { expr = true })
require('nvim-treesitter.configs').setup {
rainbow = {
enable = true,
-- Which query to use for finding delimiters
query = 'rainbow-parens',
-- Highlight the entire buffer all at once
strategy = require('ts-rainbow').strategy.global,
}
}
require('neorg').setup {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.concealer"] = {}, -- Adds pretty icons to your documents
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/notes",
},
},
},
},
}
require('smoothcursor').setup({
autostart = true,
cursor = "", -- cursor shape (need nerd font)
texthl = "SmoothCursor", -- highlight group, default is { bg = nil, fg = "#FFD400" }
linehl = nil, -- highlight sub-cursor line like 'cursorline', "CursorLine" recommended
type = "default", -- define cursor movement calculate function, "default" or "exp" (exponential).
fancy = {
enable = true, -- enable fancy mode
head = { cursor = "", texthl = "SmoothCursor", linehl = nil },
body = {
{ cursor = "", texthl = "SmoothCursorYellow" },
{ cursor = "", texthl = "SmoothCursorYellow" },
{ cursor = "", texthl = "SmoothCursorYellow" },
{ cursor = "", texthl = "SmoothCursorYellow" },
{ cursor = "", texthl = "SmoothCursorYellow" },
{ cursor = ".", texthl = "SmoothCursorYellow" },
{ cursor = ".", texthl = "SmoothCursorYellow" },
},
tail = { cursor = nil, texthl = "SmoothCursor" }
},
flyin_effect = nil, -- "bottom" or "top"
speed = 50, -- max is 100 to stick to your current position
intervals = 25, -- tick interval
priority = 10, -- set marker priority
timeout = 1500, -- timout for animation
threshold = 3, -- animate if threshold lines jump
disable_float_win = false, -- disable on float window
enabled_filetypes = nil, -- example: { "lua", "vim" }
disabled_filetypes = nil, -- this option will be skipped if enabled_filetypes is set. example: { "TelescopePrompt", "NvimTree" }
})
require('staline').setup {
defaults = {
expand_null_ls = false, -- This expands out all the null-ls sources to be shown
left_separator = "",
right_separator = "",
full_path = false,
line_column = "[%l/%L] 並%p%% ", -- `:h stl` to see all flags.
fg = "#000000", -- Foreground text color.
bg = "none", -- Default background is transparent.
inactive_color = "#303030",
inactive_bgcolor = "none",
true_colors = true, -- true lsp colors.
font_active = "none", -- "bold", "italic", "bold,italic", etc
mod_symbol = "",
lsp_client_symbol = "",
lsp_client_character_length = 12, -- Shorten LSP client names.
branch_symbol = "",
cool_symbol = "", -- Change this to override default OS icon.
null_ls_symbol = "", -- A symbol to indicate that a source is coming from null-ls
},
mode_colors = {
n = "#4799eb",
i = "#986fec",
c = "#e27d60",
v = "#2bbb4f", -- etc..
},
mode_icons = {
n = " Normal",
i = " Insert",
c = " Command",
v = " Visual", -- etc..
},
sections = {
left = { '- ', '-mode', 'left_sep_double', ' ', 'branch' },
mid = { 'file_name' },
right = { 'cool_symbol','right_sep_double', '-line_column' },
},
inactive_sections = {
left = { 'branch' },
mid = { 'file_name' },
right = { 'line_column' }
},
lsp_symbols = {
Error="",
Info="",
Warn="",
Hint="",
},
}
require'marks'.setup {
default_mappings = true,
builtin_marks = { ".", "<", ">", "^" },
cyclic = true,
force_write_shada = false,
refresh_interval = 250,
sign_priority = { lower=10, upper=15, builtin=8, bookmark=20 },
excluded_filetypes = {},
bookmark_0 = {
sign = "",
virt_text = "hello world",
-- defaults to false.
annotate = false,
},
mappings = {}
}