Initial commit
This commit is contained in:
9
.bashrc
Normal file
9
.bashrc
Normal file
@ -0,0 +1,9 @@
|
||||
alias vim='nvim'
|
||||
|
||||
|
||||
parse_git_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
}
|
||||
|
||||
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[33m\]$(parse_git_branch)\[\033[00m\]\$ '
|
||||
27
.gitignore
vendored
Normal file
27
.gitignore
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
abrt/
|
||||
.gsd-keyboard.settings-ported
|
||||
GNOME-xdg-terminals.list
|
||||
dconf/
|
||||
enchant/
|
||||
evolution/
|
||||
gnome-initial-setup-done
|
||||
google-chrome/
|
||||
gtk-3.0/
|
||||
gtk-4.0/
|
||||
ibus/
|
||||
keepassxc/
|
||||
monitors.xml
|
||||
monitors.xml~
|
||||
pulse/
|
||||
rncbc.org/
|
||||
user-dirs.dirs
|
||||
user-dirs.locale
|
||||
vlc/
|
||||
xdg-terminals.list
|
||||
autostart
|
||||
btop/
|
||||
discord/
|
||||
obs-studio/
|
||||
QtProject.conf
|
||||
pavucontrol.ini
|
||||
StardewValley/
|
||||
31
.vimrc_remote
Normal file
31
.vimrc_remote
Normal file
@ -0,0 +1,31 @@
|
||||
set clipboard+=unnamedplus
|
||||
|
||||
set number
|
||||
set relativenumber
|
||||
set mouse=a
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set smarttab
|
||||
set encoding=utf-8
|
||||
|
||||
noremap j gj
|
||||
noremap k gk
|
||||
noremap <UP> gk
|
||||
noremap <DOWN> gj
|
||||
|
||||
" fold config
|
||||
set foldmethod=indent
|
||||
set foldlevel=1
|
||||
|
||||
let &t_SI = "\e[6 q"
|
||||
let &t_EI = "\e[2 q"
|
||||
|
||||
" reset the cursor on start (for older versions of vim, usually not required)
|
||||
augroup myCmds
|
||||
au!
|
||||
autocmd VimEnter * silent !echo -ne "\e[2 q"
|
||||
augroup END
|
||||
|
||||
set ttimeout
|
||||
set ttimeoutlen=1
|
||||
set ttyfast
|
||||
17
README.md
Normal file
17
README.md
Normal file
@ -0,0 +1,17 @@
|
||||
## Config files
|
||||
|
||||
### [Neovim](https://neovim.io)
|
||||
|
||||
Install the vim plugin manager [vim-plug](https://github.com/junegunn/vim-plug).
|
||||
|
||||
Install [powerline fonts](https://github.com/powerline/fonts) for powerline statusline plugins.
|
||||
|
||||
Install the plugins with the following command:
|
||||
|
||||
```
|
||||
:PlugInstall
|
||||
```
|
||||
|
||||
### .bashrc
|
||||
|
||||
Added functionality to show current git branch in terminal
|
||||
2
nvim/after/ftplugin/markdown.lua
Normal file
2
nvim/after/ftplugin/markdown.lua
Normal file
@ -0,0 +1,2 @@
|
||||
vim.opt_local.expandtab = true
|
||||
vim.opt_local.shiftwidth = 2
|
||||
1
nvim/after/ftplugin/scss.lua
Normal file
1
nvim/after/ftplugin/scss.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt_local.shiftwidth = 4
|
||||
1
nvim/after/ftplugin/vim.lua
Normal file
1
nvim/after/ftplugin/vim.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt_local.textwidth = 0
|
||||
2
nvim/init.lua
Normal file
2
nvim/init.lua
Normal file
@ -0,0 +1,2 @@
|
||||
require('config.core')
|
||||
require('config.lazy')
|
||||
38
nvim/lazy-lock.json
Normal file
38
nvim/lazy-lock.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" },
|
||||
"auto-session": { "branch": "main", "commit": "9d02776ed42874d37869dc683396234e3724b52d" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "2e3c8cc5a57ddd32f1edd2ffd2ccb10c09421f6c" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "59c3f419af48a2ffb2320cea85e44e5a95f71664" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"monokai-nightasty.nvim": { "branch": "main", "commit": "340bed332b76d59ecd999f9dda5538a53464da3a" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||
"none-ls-extras.nvim": { "branch": "main", "commit": "f2bb002c8aa644d1f253772ff5d4e75e45ff7f4f" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "dcc8cd4efdcb29275681a3c95786a816330dbca6" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "541f3a2781de481bb84883889e4d9f0904250a56" },
|
||||
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "f5f67892996b280ae78b1b0a2d07c4fa29ae0905" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "03452942dfbd998701d4123ccad2090e1bc7e9f1" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"vim-airline": { "branch": "master", "commit": "81eca994860645acbb58442285cdd70df5c71d2b" },
|
||||
"vim-airline-themes": { "branch": "master", "commit": "a9aa25ce323b2dd04a52706f4d1b044f4feb7617" },
|
||||
"vim-floaterm": { "branch": "master", "commit": "4e28c8dd0271e10a5f55142fb6fe9b1599ee6160" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
||||
}
|
||||
2
nvim/lua/config/core/init.lua
Normal file
2
nvim/lua/config/core/init.lua
Normal file
@ -0,0 +1,2 @@
|
||||
require('config.core.keymaps')
|
||||
require('config.core.options')
|
||||
27
nvim/lua/config/core/keymaps.lua
Normal file
27
nvim/lua/config/core/keymaps.lua
Normal file
@ -0,0 +1,27 @@
|
||||
local keymap = vim.keymap
|
||||
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- INSERT MODE
|
||||
|
||||
-- map `ctrl + backspace` to delete previous word in insert mode
|
||||
keymap.set('i', '<C-H>', '<C-W>', opts)
|
||||
|
||||
-- map `ctrl + delete` to delete next word in insert mode
|
||||
keymap.set('i', '<C-Del>', '<C-o>dw', opts)
|
||||
|
||||
|
||||
-- NORMAL MODE
|
||||
|
||||
-- navigate in visual linewraps
|
||||
keymap.set('n', 'k', 'gk', opts)
|
||||
keymap.set('n', 'j', 'gj', opts)
|
||||
keymap.set('n', '<UP>', 'gk', opts)
|
||||
keymap.set('n', '<DOWN>', 'gj', opts)
|
||||
|
||||
|
||||
-- COMMANDS
|
||||
|
||||
-- print current working directory
|
||||
vim.api.nvim_create_user_command('Cwd', function() print(vim.fn.getcwd()) end, {})
|
||||
38
nvim/lua/config/core/options.lua
Normal file
38
nvim/lua/config/core/options.lua
Normal file
@ -0,0 +1,38 @@
|
||||
local opt = vim.opt
|
||||
|
||||
-- numbers
|
||||
opt.relativenumber = true
|
||||
opt.number = true
|
||||
|
||||
-- enable mouse in all modes
|
||||
opt.mouse = 'a'
|
||||
-- opt.mousemoveevent = true
|
||||
|
||||
-- tabs
|
||||
opt.autoindent = true
|
||||
opt.tabstop = 4
|
||||
opt.softtabstop = 4
|
||||
opt.shiftwidth = 4
|
||||
opt.smarttab = true
|
||||
|
||||
-- default encodings to utf-8
|
||||
opt.encoding = 'utf-8'
|
||||
opt.fileencoding = 'utf-8'
|
||||
-- opt.termencoding = 'utf-8' -- currently broken
|
||||
|
||||
-- folds
|
||||
opt.foldmethod = 'indent'
|
||||
opt.foldlevelstart = 99
|
||||
opt.foldlevel = 1
|
||||
|
||||
-- search
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
|
||||
-- styling
|
||||
opt.scrolloff = 5
|
||||
opt.wrap = true
|
||||
opt.showbreak = '++'
|
||||
opt.breakindent = true
|
||||
opt.linebreak = true
|
||||
opt.termguicolors = true
|
||||
28
nvim/lua/config/lazy.lua
Normal file
28
nvim/lua/config/lazy.lua
Normal file
@ -0,0 +1,28 @@
|
||||
local lazypath = vim.fn.stdpath('data') .. 'lazy/lazy.nvim'
|
||||
|
||||
-- bootstrap lazy
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
|
||||
{ out, 'WarningMsg' },
|
||||
{ '\nPress any key to exit...' },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = '\\'
|
||||
|
||||
-- setup lazy and import plugins
|
||||
require('lazy').setup({
|
||||
spec = {
|
||||
{ import = 'config.plugins' },
|
||||
{ import = 'config.plugins.lsp' },
|
||||
},
|
||||
})
|
||||
35
nvim/lua/config/plugins/airline.lua
Normal file
35
nvim/lua/config/plugins/airline.lua
Normal file
@ -0,0 +1,35 @@
|
||||
return {
|
||||
'vim-airline/vim-airline',
|
||||
dependencies = {
|
||||
'vim-airline/vim-airline-themes',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function()
|
||||
vim.g.airline_theme = 'base16_monokai'
|
||||
vim.g.airline_powerline_fonts = 1
|
||||
-- vim.g.airline_symbols = {}
|
||||
|
||||
-- unicode symbols
|
||||
vim.g.airline_left_sep = '»'
|
||||
vim.g.airline_left_sep = '▶'
|
||||
vim.g.airline_right_sep = '«'
|
||||
vim.g.airline_right_sep = '◀'
|
||||
vim.g.airline_symbols.linenr = '␊'
|
||||
vim.g.airline_symbols.linenr = ''
|
||||
vim.g.airline_symbols.linenr = '¶'
|
||||
vim.g.airline_symbols.branch = '⎇'
|
||||
vim.g.airline_symbols.paste = 'ρ'
|
||||
vim.g.airline_symbols.paste = 'Þ'
|
||||
vim.g.airline_symbols.paste = '∥'
|
||||
vim.g.airline_symbols.whitespace = 'Ξ'
|
||||
|
||||
-- airline symbols
|
||||
vim.g.airline_left_sep = ''
|
||||
vim.g.airline_left_alt_sep = ''
|
||||
vim.g.airline_right_sep = ''
|
||||
vim.g.airline_right_alt_sep = ''
|
||||
vim.g.airline_symbols.branch = ''
|
||||
vim.g.airline_symbols.readonly = ''
|
||||
vim.g.airline_symbols.linenr = ''
|
||||
end,
|
||||
}
|
||||
40
nvim/lua/config/plugins/alpha.lua
Normal file
40
nvim/lua/config/plugins/alpha.lua
Normal file
@ -0,0 +1,40 @@
|
||||
return {
|
||||
'goolord/alpha-nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
event = 'VimEnter',
|
||||
config = function()
|
||||
local alpha = require('alpha')
|
||||
local startify = require('alpha.themes.startify')
|
||||
|
||||
-- startify.section.header.val = {
|
||||
-- '░▒▓███████▓▒░ ░▒▓████████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓██████████████▓▒░ ',
|
||||
-- '░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░',
|
||||
-- '░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░',
|
||||
-- '░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░',
|
||||
-- '░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░',
|
||||
-- '░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░',
|
||||
-- '░▒▓█▓▒░░▒▓█▓▒░░▒▓████████▓▒░░▒▓██████▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░',
|
||||
-- ' '
|
||||
-- }
|
||||
|
||||
alpha.setup(startify.opts)
|
||||
|
||||
local alpha_start_group = vim.api.nvim_create_augroup('AlphaStart', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TabNewEntered', {
|
||||
callback = function()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local bufname = vim.api.nvim_buf_get_name(bufnr)
|
||||
|
||||
-- Start alpha if no file associated with buffer
|
||||
if bufname == '' then
|
||||
alpha.start()
|
||||
end
|
||||
end,
|
||||
group = alpha_start_group
|
||||
})
|
||||
|
||||
-- vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
|
||||
end
|
||||
}
|
||||
55
nvim/lua/config/plugins/auto-session.lua
Normal file
55
nvim/lua/config/plugins/auto-session.lua
Normal file
@ -0,0 +1,55 @@
|
||||
return {
|
||||
'rmagatti/auto-session',
|
||||
lazy = false,
|
||||
config = function()
|
||||
local auto_session = require('auto-session')
|
||||
auto_session.setup({
|
||||
auto_save = false,
|
||||
auto_restore = false,
|
||||
post_restore_cmds = {
|
||||
function ()
|
||||
local buf_exists = function(bufname)
|
||||
for _, buf in ipairs(vim.fn.getbufinfo({ bufloaded = true })) do
|
||||
if buf.name:match(bufname) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- If NvimTree was opened when the session was saved, show it
|
||||
if buf_exists('NvimTree_') then
|
||||
require('nvim-tree.api').tree.open()
|
||||
end
|
||||
end
|
||||
}
|
||||
})
|
||||
|
||||
local opts = { silent = true, noremap = true }
|
||||
|
||||
local keymap = vim.keymap
|
||||
keymap.set('n', '<leader>ss', '<cmd>SessionSave<cr>', opts)
|
||||
keymap.set('n', '<leader>sq', '<cmd>SessionSave<cr><cmd>wa<cr><cmd>qa<cr>', opts)
|
||||
keymap.set('n', '<leader>sl', '<cmd>SessionSearch<cr>', opts)
|
||||
keymap.set('n', '<leader>sr', '<cmd>SessionRestore<cr>', opts)
|
||||
keymap.set('n', '<leader>sd', '<cmd>Autosession delete<cr>', opts)
|
||||
|
||||
local function named_save()
|
||||
vim.ui.input({ prompt = 'Enter Session name: ' }, function(input)
|
||||
auto_session.SaveSession(input)
|
||||
end)
|
||||
end
|
||||
keymap.set('n', '<leader>sS', named_save, opts)
|
||||
|
||||
local wk = require('which-key')
|
||||
wk.add({
|
||||
{ '<leader>s', group = 'auto-session' },
|
||||
{ '<leader>ss', desc = 'SessionSave' },
|
||||
{ '<leader>sS', desc = 'NamedSessionSave' },
|
||||
{ '<leader>sq', desc = 'Save and Quit' },
|
||||
{ '<leader>sl', desc = 'SessionList (SessionSearch)'},
|
||||
{ '<leader>sr', desc = 'SessionRestore'},
|
||||
{ '<leader>sd', desc = 'SessionDelete'},
|
||||
})
|
||||
end,
|
||||
}
|
||||
22
nvim/lua/config/plugins/autopairs.lua
Normal file
22
nvim/lua/config/plugins/autopairs.lua
Normal file
@ -0,0 +1,22 @@
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = { 'InsertEnter' },
|
||||
dependencies = {
|
||||
'hrsh7th/nvim-cmp',
|
||||
},
|
||||
config = function()
|
||||
local autopairs = require('nvim-autopairs')
|
||||
|
||||
autopairs.setup({
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
javascript = { 'template_string' },
|
||||
},
|
||||
})
|
||||
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
24
nvim/lua/config/plugins/bufferline.lua
Normal file
24
nvim/lua/config/plugins/bufferline.lua
Normal file
@ -0,0 +1,24 @@
|
||||
return {
|
||||
'akinsho/bufferline.nvim',
|
||||
lazy = false,
|
||||
version = '*',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function ()
|
||||
local bufferline = require('bufferline')
|
||||
bufferline.setup({
|
||||
options = {
|
||||
hover = {
|
||||
enabled = true,
|
||||
delay = 200,
|
||||
reveal = {'close'}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
local map = vim.keymap.set
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
map('n', '<A-Left>', '<cmd>BufferLineCyclePrev<cr>', opts)
|
||||
map('n', '<A-Right>', '<cmd>BufferLineCycleNext<cr>', opts)
|
||||
end
|
||||
}
|
||||
55
nvim/lua/config/plugins/cmp.lua
Normal file
55
nvim/lua/config/plugins/cmp.lua
Normal file
@ -0,0 +1,55 @@
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||
"hrsh7th/cmp-path", -- source for file system paths
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip", -- for autocompletion
|
||||
"rafamadriz/friendly-snippets", -- useful snippets
|
||||
"onsails/lspkind.nvim", -- vs-code like pictograms
|
||||
},
|
||||
config = function()
|
||||
-- TODO keybindings
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
local lspkind = require('lspkind')
|
||||
-- require('lspkind.loaders.from_vscode').lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
-- preselect = nil,
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,preview',
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<Tab>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<Enter>'] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
}),
|
||||
-- formatting = {
|
||||
-- format = lspkind.cmp_format({
|
||||
-- maxwidth = 50,
|
||||
-- ellipsis_char = '...',
|
||||
-- }),
|
||||
-- },
|
||||
})
|
||||
end,
|
||||
}
|
||||
8
nvim/lua/config/plugins/colorscheme.lua
Normal file
8
nvim/lua/config/plugins/colorscheme.lua
Normal file
@ -0,0 +1,8 @@
|
||||
return {
|
||||
'polirritmico/monokai-nightasty.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require('monokai-nightasty').setup()
|
||||
vim.cmd('colorscheme monokai-nightasty')
|
||||
end,
|
||||
}
|
||||
3
nvim/lua/config/plugins/diffview.lua
Normal file
3
nvim/lua/config/plugins/diffview.lua
Normal file
@ -0,0 +1,3 @@
|
||||
return {
|
||||
'sindrets/diffview.nvim'
|
||||
}
|
||||
4
nvim/lua/config/plugins/dressing.lua
Normal file
4
nvim/lua/config/plugins/dressing.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return {
|
||||
'stevearc/dressing.nvim',
|
||||
opts = {}
|
||||
}
|
||||
18
nvim/lua/config/plugins/floaterm.lua
Normal file
18
nvim/lua/config/plugins/floaterm.lua
Normal file
@ -0,0 +1,18 @@
|
||||
return {
|
||||
'voldikss/vim-floaterm',
|
||||
config = function ()
|
||||
local keymap = vim.keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
keymap.set('n', '<C-q>', '<cmd>FloatermToggle<cr>', opts)
|
||||
keymap.set('t', '<C-q>', '<cmd>FloatermToggle<cr>', opts)
|
||||
keymap.set('t', '<PageUp>', '<cmd>FloatermPrev<cr>', opts)
|
||||
keymap.set('t', '<PageDown>', '<cmd>FloatermNext<cr>', opts)
|
||||
|
||||
local wk = require('which-key')
|
||||
wk.add({
|
||||
{ '<leader>t', group = 'Floaterm', icon = { icon = ' ', color = 'red' } },
|
||||
{ '<leader>tn', '<leader>tn', desc = 'New Terminal', noremap = true, silent = true },
|
||||
{ '<leader>tt', '<leader>tt', desc = 'Toggle Terminal', noremap = true, silent = true },
|
||||
})
|
||||
end
|
||||
}
|
||||
3
nvim/lua/config/plugins/init.lua
Normal file
3
nvim/lua/config/plugins/init.lua
Normal file
@ -0,0 +1,3 @@
|
||||
return {
|
||||
'nvim-lua/plenary.nvim', -- dependency of many plungins
|
||||
}
|
||||
14
nvim/lua/config/plugins/lazygit.lua
Normal file
14
nvim/lua/config/plugins/lazygit.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
'kdheepak/lazygit.nvim',
|
||||
lazy = true,
|
||||
cmd = {
|
||||
'LazyGit',
|
||||
'LazyGitConfig',
|
||||
'LazyGitCurrentFile',
|
||||
'LazyGitFilter',
|
||||
'LazyGitFilterCurrentFile',
|
||||
},
|
||||
depedencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
}
|
||||
81
nvim/lua/config/plugins/lsp/lspconfig.lua
Normal file
81
nvim/lua/config/plugins/lsp/lspconfig.lua
Normal file
@ -0,0 +1,81 @@
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
{ 'antosha417/nvim-lsp-file-operations', config = true },
|
||||
{ 'folke/neodev.nvim', opts = {} },
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require('lspconfig')
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
local cmp_nvim_lsp = require('cmp_nvim_lsp')
|
||||
local keymap = vim.keymap
|
||||
local wk = require('which-key')
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
local function opts(desc)
|
||||
return { desc = desc, buffer = ev.buf, silent = true }
|
||||
end
|
||||
|
||||
keymap.set('n', 'K', vim.lsp.buf.hover, opts('Show documentation'))
|
||||
keymap.set('n', 'gR', '<cmd>Telescope lsp_references<cr>', opts('Show LSP references'))
|
||||
keymap.set('n', 'gD', vim.lsp.buf.declaration, opts('Go to declaration'))
|
||||
keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<cr>', opts('Show LSP definitions'))
|
||||
keymap.set('n', 'gi', '<cmd>Telescope lsp_implementations<cr>', opts('Show LSP implementations'))
|
||||
keymap.set('n', 'gt', '<cmd>Telescope lsp_type_definitions<cr>', opts('Show LSP type definitions'))
|
||||
keymap.set({ 'n', 'v' }, 'ga', vim.lsp.buf.code_action, opts('Show available code actions'))
|
||||
wk.add({
|
||||
{ '<leader>r', group = 'Rename' },
|
||||
{ '<leader>rn', vim.lsp.buf.rename, desc = 'Smart Rename' },
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
mason_lspconfig.setup_handlers({
|
||||
-- default handler for installed servers
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
-- TODO add lsp configs
|
||||
['lua_ls'] = function()
|
||||
lspconfig['lua_ls'].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
completion = {
|
||||
callSnippet = 'Replace'
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
end,
|
||||
['emmet_ls'] = function()
|
||||
-- capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
lspconfig['emmet_ls'].setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = {
|
||||
'html',
|
||||
'css',
|
||||
'sass',
|
||||
'scss',
|
||||
'less',
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'svelte',
|
||||
'vue',
|
||||
}
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
46
nvim/lua/config/plugins/lsp/mason.lua
Normal file
46
nvim/lua/config/plugins/lsp/mason.lua
Normal file
@ -0,0 +1,46 @@
|
||||
return {
|
||||
'williamboman/mason.nvim',
|
||||
dependencies = {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
},
|
||||
config = function()
|
||||
local mason = require('mason')
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
local mason_tool_installer = require('mason-tool-installer')
|
||||
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
pip = {
|
||||
upgrade_pip = true,
|
||||
}
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = {
|
||||
'lua_ls',
|
||||
'html',
|
||||
'cssls',
|
||||
'pyright',
|
||||
'emmet_ls',
|
||||
'bashls',
|
||||
},
|
||||
})
|
||||
|
||||
mason_tool_installer.setup({
|
||||
ensure_installed = {
|
||||
'prettier',
|
||||
'isort',
|
||||
'black',
|
||||
'pylint',
|
||||
'eslint_d',
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
41
nvim/lua/config/plugins/lsp/null-ls.lua
Normal file
41
nvim/lua/config/plugins/lsp/null-ls.lua
Normal file
@ -0,0 +1,41 @@
|
||||
return {
|
||||
'nvimtools/none-ls.nvim',
|
||||
dependencies = {
|
||||
'nvimtools/none-ls-extras.nvim'
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require('null-ls')
|
||||
|
||||
local sources = {
|
||||
null_ls.builtins.formatting.prettier.with({
|
||||
filetypes = { 'javascript', 'typescript', 'css', 'html', 'json', 'markdown', 'yaml' }
|
||||
}),
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.djlint,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
require('none-ls.diagnostics.eslint_d'),
|
||||
}
|
||||
|
||||
null_ls.setup({
|
||||
sources = sources,
|
||||
-- on_attach = function(client, bufnr)
|
||||
-- if client.server_capabilities.documentFormattingProvider then
|
||||
-- vim.
|
||||
-- end
|
||||
-- end,
|
||||
})
|
||||
|
||||
local keymap = vim.keymap
|
||||
local fmt_func = function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end
|
||||
keymap.set('n', '<leader>ii', fmt_func, { noremap = true, silent = true })
|
||||
|
||||
local wk = require('which-key')
|
||||
wk.add({
|
||||
{ '<leader>i', group = 'Formatting' },
|
||||
{ '<leader>ii', desc = 'Format File' },
|
||||
})
|
||||
end,
|
||||
}
|
||||
24
nvim/lua/config/plugins/nvim-tree.lua
Normal file
24
nvim/lua/config/plugins/nvim-tree.lua
Normal file
@ -0,0 +1,24 @@
|
||||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function ()
|
||||
local nvim_tree = require('nvim-tree')
|
||||
local api = require('nvim-tree.api')
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
nvim_tree.setup()
|
||||
|
||||
local keymap = vim.keymap
|
||||
keymap.set('n', '<leader>ee', api.tree.toggle, { noremap = true, silent = true })
|
||||
|
||||
local wk = require('which-key')
|
||||
wk.add({
|
||||
{ '<leader>e', group = 'nvim-tree', icon = { icon = ' ', color = 'orange' } },
|
||||
{ '<leader>ee', group = 'Toggle tree' }
|
||||
})
|
||||
end
|
||||
}
|
||||
6
nvim/lua/config/plugins/surround.lua
Normal file
6
nvim/lua/config/plugins/surround.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
'kylechui/nvim-surround',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
version = '*',
|
||||
config = true,
|
||||
}
|
||||
43
nvim/lua/config/plugins/telescope.lua
Normal file
43
nvim/lua/config/plugins/telescope.lua
Normal file
@ -0,0 +1,43 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require('telescope')
|
||||
-- local actions = require('telescope.actions')
|
||||
-- local transform_mod = require('telescope.actions.mt').transform_mod
|
||||
-- local trouble = require('trouble')
|
||||
-- local trouble_telescope = require('trouble.sources.telescope')
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
path_display = { 'smart' },
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension('fzf')
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local keymap = vim.keymap
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
keymap.set('n', '<leader>ff', builtin.find_files, opts)
|
||||
keymap.set('n', '<leader>fh', builtin.oldfiles, opts)
|
||||
keymap.set('n', '<leader>fs', builtin.live_grep, opts)
|
||||
keymap.set('n', '<leader>fc', builtin.grep_string, opts)
|
||||
|
||||
local wk = require('which-key')
|
||||
wk.add({
|
||||
{ '<leader>f', group = 'telescope' },
|
||||
{ '<leader>ff', desc = 'Find Files'},
|
||||
{ '<leader>fh', desc = 'Recent Files'},
|
||||
{ '<leader>fs', desc = 'Search Text in Files'},
|
||||
{ '<leader>fc', desc = 'Search Text under Cursor'},
|
||||
})
|
||||
end,
|
||||
}
|
||||
51
nvim/lua/config/plugins/treesitter.lua
Normal file
51
nvim/lua/config/plugins/treesitter.lua
Normal file
@ -0,0 +1,51 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require('nvim-treesitter.configs')
|
||||
|
||||
treesitter.setup({
|
||||
auto_install = true,
|
||||
sync_install = false,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = { enable = true },
|
||||
autotag = { enable = true },
|
||||
ensure_installed = {
|
||||
'json',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'yaml',
|
||||
'html',
|
||||
'htmldjango',
|
||||
'css',
|
||||
'scss',
|
||||
'markdown',
|
||||
'markdown_inline',
|
||||
'bash',
|
||||
'lua',
|
||||
'vim',
|
||||
'dockerfile',
|
||||
'python',
|
||||
'gitignore',
|
||||
'c',
|
||||
},
|
||||
ignore_install = {},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<C-Space>',
|
||||
node_incremental = '<C-Space>',
|
||||
scope_incremental = false,
|
||||
node_decremental = '<bs>',
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
12
nvim/lua/config/plugins/which-key.lua
Normal file
12
nvim/lua/config/plugins/which-key.lua
Normal file
@ -0,0 +1,12 @@
|
||||
return {
|
||||
'folke/which-key.nvim',
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
local wk = require('which-key')
|
||||
wk.add({
|
||||
{ '<leader>nh', '<cmd>nohl<cr>', desc = 'No Highlight' },
|
||||
{ '<leader>l', group = 'LazyGit', icon = { icon = '', color = 'cyan' } },
|
||||
{ '<leader>lg', '<cmd>LazyGit<cr>', desc = 'Open LazyGit', icon = { icon = '', color = 'cyan' } },
|
||||
})
|
||||
end
|
||||
}
|
||||
144
starship.toml
Normal file
144
starship.toml
Normal file
@ -0,0 +1,144 @@
|
||||
format = """
|
||||
[](#9A348E)\
|
||||
$os\
|
||||
$username\
|
||||
[](bg:#DA627D fg:#9A348E)\
|
||||
$directory\
|
||||
[](fg:#DA627D bg:#FCA17D)\
|
||||
$git_branch\
|
||||
$git_status\
|
||||
[](fg:#FCA17D bg:#86BBD8)\
|
||||
$c\
|
||||
$elixir\
|
||||
$elm\
|
||||
$golang\
|
||||
$gradle\
|
||||
$haskell\
|
||||
$java\
|
||||
$julia\
|
||||
$nodejs\
|
||||
$nim\
|
||||
$rust\
|
||||
$scala\
|
||||
[](fg:#86BBD8 bg:#06969A)\
|
||||
$docker_context\
|
||||
[](fg:#06969A bg:#33658A)\
|
||||
$time\
|
||||
[ ](fg:#33658A)\
|
||||
"""
|
||||
|
||||
# Disable the blank line at the start of the prompt
|
||||
# add_newline = false
|
||||
|
||||
# You can also replace your username with a neat symbol like or disable this
|
||||
# and use the os module below
|
||||
[username]
|
||||
show_always = true
|
||||
style_user = "bg:#9A348E"
|
||||
style_root = "bg:#9A348E"
|
||||
format = '[$user ]($style)'
|
||||
disabled = false
|
||||
|
||||
# An alternative to the username module which displays a symbol that
|
||||
# represents the current operating system
|
||||
[os]
|
||||
style = "bg:#9A348E"
|
||||
disabled = true # Disabled by default
|
||||
|
||||
[directory]
|
||||
style = "bg:#DA627D"
|
||||
format = "[ $path ]($style)"
|
||||
truncation_length = 3
|
||||
truncation_symbol = "…/"
|
||||
|
||||
# Here is how you can shorten some long paths by text replacement
|
||||
# similar to mapped_locations in Oh My Posh:
|
||||
[directory.substitutions]
|
||||
"Documents" = " "
|
||||
"Downloads" = " "
|
||||
"Music" = " "
|
||||
"Pictures" = " "
|
||||
# Keep in mind that the order matters. For example:
|
||||
# "Important Documents" = " "
|
||||
# will not be replaced, because "Documents" was already substituted before.
|
||||
# So either put "Important Documents" before "Documents" or use the substituted version:
|
||||
# "Important " = " "
|
||||
|
||||
[c]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[docker_context]
|
||||
symbol = " "
|
||||
style = "bg:#06969A"
|
||||
format = '[ $symbol $context ]($style)'
|
||||
|
||||
[elixir]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[elm]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[git_branch]
|
||||
symbol = ""
|
||||
style = "bg:#FCA17D"
|
||||
format = '[ $symbol $branch ]($style)'
|
||||
|
||||
[git_status]
|
||||
style = "bg:#FCA17D"
|
||||
format = '[$all_status$ahead_behind ]($style)'
|
||||
|
||||
[golang]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[gradle]
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[haskell]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[java]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[julia]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[nodejs]
|
||||
symbol = ""
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[nim]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[rust]
|
||||
symbol = ""
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[scala]
|
||||
symbol = " "
|
||||
style = "bg:#86BBD8"
|
||||
format = '[ $symbol ($version) ]($style)'
|
||||
|
||||
[time]
|
||||
disabled = false
|
||||
time_format = "%R" # Hour:Minute Format
|
||||
style = "bg:#33658A"
|
||||
format = '[ ♥ $time ]($style)'
|
||||
Reference in New Issue
Block a user