Compare commits
46 Commits
4245c60b54
...
94a11fc4d4
Author | SHA1 | Date | |
---|---|---|---|
94a11fc4d4 | |||
db798ec1e5 | |||
1ffff0e180 | |||
6e3fdd2efe | |||
|
9555ab88a1 | ||
|
9d5f4047ca | ||
|
8a5fb4a48d | ||
|
822df45772 | ||
|
c329108285 | ||
|
2f532d405d | ||
|
df51df316b | ||
|
e46a22ddd6 | ||
|
e1bdec5276 | ||
|
a27ec9c950 | ||
|
68fd48afed | ||
|
18a82b51aa | ||
|
5fad30d9af | ||
|
580d92b4f2 | ||
|
89e833f65e | ||
|
5b4a9e26f5 | ||
|
6f4157bb43 | ||
|
d7bc1d97a9 | ||
|
80812fba63 | ||
|
67cd260c15 | ||
|
0f1b7ae40a | ||
|
4d8f72b127 | ||
|
f4d73c543c | ||
|
6652298948 | ||
|
29b84cfe88 | ||
|
685853603b | ||
|
864e02dc05 | ||
|
b2a4bdc5eb | ||
|
522ee244af | ||
|
0bbd824cf0 | ||
|
184735fbea | ||
|
15ba81073a | ||
|
d68fbd645d | ||
|
17698c21d3 | ||
|
3c6ec3e56b | ||
|
859f1679b2 | ||
|
9bbcfb9332 | ||
|
00c823bec0 | ||
|
04680f395a | ||
|
21669a106f | ||
|
eb4be258da | ||
|
e1ef9c36b1 |
35
.vimrc
Executable file
35
.vimrc
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
syntax on
|
||||||
|
set modelines=0
|
||||||
|
set hidden
|
||||||
|
set number
|
||||||
|
set ruler
|
||||||
|
set visualbell
|
||||||
|
set textwidth=120
|
||||||
|
set cursorline
|
||||||
|
hi CursorLine term=bold cterm=bold ctermbg=darkgrey
|
||||||
|
set tabstop=2
|
||||||
|
set shiftwidth=2
|
||||||
|
set matchpairs+=<:>
|
||||||
|
set showmode
|
||||||
|
set showcmd
|
||||||
|
set showmatch
|
||||||
|
set hlsearch
|
||||||
|
set ignorecase
|
||||||
|
set smartcase
|
||||||
|
set incsearch
|
||||||
|
set wrapscan
|
||||||
|
set scrolloff=999
|
||||||
|
set backspace=indent,eol,start
|
||||||
|
set mouse=nicr
|
||||||
|
"Leader
|
||||||
|
nnoremap <SPACE> <Nop>
|
||||||
|
let mapleader=" "
|
||||||
|
"mappings
|
||||||
|
map <leader>h :set cursorline!<CR>
|
||||||
|
"map <leader>c :!yarn copy-start<CR>
|
||||||
|
"map <leader>b :!yarn build<CR>
|
||||||
|
"map <leader>bs :!yarn build-start<CR>
|
||||||
|
|
||||||
|
xnoremap p "_dP
|
||||||
|
nnoremap <esc><esc> :noh<return><esc>
|
||||||
|
|
8
nvim/.netrwhist
Normal file
8
nvim/.netrwhist
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
let g:netrw_dirhistmax =10
|
||||||
|
let g:netrw_dirhistcnt =6
|
||||||
|
let g:netrw_dirhist_6='/home/markus/.vim'
|
||||||
|
let g:netrw_dirhist_5='/home/markus/dev/typescript/node-pos-erp-mapper/server/components/sap/fi'
|
||||||
|
let g:netrw_dirhist_4='/home/markus/dev/typescript/node-pos-erp-mapper/server/components/sap'
|
||||||
|
let g:netrw_dirhist_3='/home/markus/dev/typescript/node-pos-erp-mapper/server/components'
|
||||||
|
let g:netrw_dirhist_2='/home/markus/dev/typescript/node-pos-erp-mapper/server'
|
||||||
|
let g:netrw_dirhist_1='/home/markus/dev/typescript/node-pos-erp-mapper'
|
19
nvim/init.lua
Normal file
19
nvim/init.lua
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
require('keymap')
|
||||||
|
require('plugins')
|
||||||
|
require('globals_opts')
|
||||||
|
require('native_commands')
|
||||||
|
require('nvim-lightbulb_config')
|
||||||
|
require('nvimtree')
|
||||||
|
require('treesitter_config')
|
||||||
|
require('dap_config')
|
||||||
|
require('mason_config')
|
||||||
|
require('new_lsp_conf')
|
||||||
|
require('cmp_config')
|
||||||
|
require('toggleterm_config')
|
||||||
|
require('virtual_lines_config')
|
||||||
|
require("null-ls_config")
|
||||||
|
require("telescope_config")
|
||||||
|
require("nvimtest_config")
|
||||||
|
require("neotest_config")
|
||||||
|
require("trouble_config")
|
141
nvim/init.vim_bkp
Normal file
141
nvim/init.vim_bkp
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
set runtimepath^=/.vim runtimepath+=~/.vim/after
|
||||||
|
let &packpath = &runtimepath
|
||||||
|
"syntax on
|
||||||
|
set modelines=0
|
||||||
|
set hidden
|
||||||
|
set number
|
||||||
|
set ruler
|
||||||
|
set visualbell
|
||||||
|
set textwidth=120
|
||||||
|
set cursorline
|
||||||
|
hi CursorLine term=bold cterm=bold ctermbg=darkgrey
|
||||||
|
set tabstop=2
|
||||||
|
set softtabstop=2
|
||||||
|
set expandtab
|
||||||
|
set shiftwidth=2
|
||||||
|
set matchpairs+=<:>
|
||||||
|
set showmode
|
||||||
|
set showcmd
|
||||||
|
set showmatch
|
||||||
|
set hlsearch
|
||||||
|
set ignorecase
|
||||||
|
set smartcase
|
||||||
|
set incsearch
|
||||||
|
set wrapscan
|
||||||
|
set scrolloff=999
|
||||||
|
set backspace=indent,eol,start
|
||||||
|
set mouse=nicr
|
||||||
|
set termguicolors
|
||||||
|
|
||||||
|
call plug#begin(stdpath('data') . '/plugged')
|
||||||
|
Plug 'williamboman/mason.nvim'
|
||||||
|
Plug 'williamboman/mason-lspconfig.nvim'
|
||||||
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
|
Plug 'junegunn/vim-easy-align'
|
||||||
|
Plug 'morhetz/gruvbox'
|
||||||
|
Plug 'junegunn/fzf', {'do': {->fzf#install()}}
|
||||||
|
Plug 'junegunn/fzf.vim'
|
||||||
|
Plug 'gfanto/fzf-lsp.nvim'
|
||||||
|
Plug 'nvim-lua/lsp-status.nvim'
|
||||||
|
Plug 'jiangmiao/auto-pairs'
|
||||||
|
Plug 'machakann/vim-sandwich'
|
||||||
|
Plug 'machakann/vim-highlightedyank'
|
||||||
|
Plug 'bling/vim-airline'
|
||||||
|
Plug 'airblade/vim-gitgutter'
|
||||||
|
Plug 'rhysd/vim-clang-format'
|
||||||
|
Plug 'easymotion/vim-easymotion'
|
||||||
|
Plug 'neovim/nvim-lspconfig'
|
||||||
|
Plug 'kosayoda/nvim-lightbulb'
|
||||||
|
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||||
|
Plug 'hrsh7th/cmp-buffer'
|
||||||
|
Plug 'hrsh7th/cmp-path'
|
||||||
|
Plug 'hrsh7th/cmp-cmdline'
|
||||||
|
Plug 'hrsh7th/nvim-cmp'
|
||||||
|
Plug 'saadparwaiz1/cmp_luasnip'
|
||||||
|
Plug 'L3MON4D3/LuaSnip'
|
||||||
|
Plug 'kyazdani42/nvim-web-devicons'
|
||||||
|
Plug 'kyazdani42/nvim-tree.lua'
|
||||||
|
Plug 'tpope/vim-fugitive'
|
||||||
|
Plug 'mfussenegger/nvim-dap'
|
||||||
|
Plug 'David-Kunz/jester'
|
||||||
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||||
|
Plug 'waycrate/swhkd-vim'
|
||||||
|
Plug 'kmonad/kmonad-vim'
|
||||||
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
|
Plug 'akinsho/toggleterm.nvim', {'tag' : 'v2.*'}
|
||||||
|
Plug 'https://git.sr.ht/~whynothugo/lsp_lines.nvim'
|
||||||
|
Plug 'MunifTanjim/nui.nvim'
|
||||||
|
Plug 'arnarg/todotxt.nvim'
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
autocmd vimenter * colorscheme gruvbox
|
||||||
|
autocmd BufEnter *.60 :setlocal filetype=sixtyfps
|
||||||
|
let g:clang_format#auto_format=0
|
||||||
|
|
||||||
|
set completeopt=menuone,noselect
|
||||||
|
|
||||||
|
|
||||||
|
highlight NvimTreeFolderIcon guibg=blue
|
||||||
|
|
||||||
|
lua require('cmp_config')
|
||||||
|
lua require('nvimtree')
|
||||||
|
lua require('lsp_conf')
|
||||||
|
lua require('treesitter_config')
|
||||||
|
lua require('dap_config')
|
||||||
|
lua require('jester')
|
||||||
|
lua require('mason_config')
|
||||||
|
lua require('toggleterm_config')
|
||||||
|
lua require('virtual_lines_config')
|
||||||
|
lua require('todotxt_config')
|
||||||
|
|
||||||
|
"Leader
|
||||||
|
nnoremap <SPACE> <Nop>
|
||||||
|
let mapleader=" "
|
||||||
|
"mappings
|
||||||
|
map <leader>h :set cursorline!<CR>
|
||||||
|
"map <leader>c :!yarn copy-start<CR>
|
||||||
|
"map <leader>b :!yarn build<CR>
|
||||||
|
"map <leader>bs :!yarn build-start<CR>
|
||||||
|
|
||||||
|
nnoremap <C-n> :NvimTreeToggle<CR>
|
||||||
|
nnoremap <leader>r :NvimTreeRefresh<CR>
|
||||||
|
nnoremap <leader>n :NvimTreeFindFile<CR>
|
||||||
|
" NvimTreeOpen, NvimTreeClose, NvimTreeFocus, NvimTreeFindFileToggle, and NvimTreeResize are also available if you need them
|
||||||
|
xnoremap p "_dP
|
||||||
|
nnoremap <esc><esc> :noh<return><esc>
|
||||||
|
map <leader>f :FZF<CR>
|
||||||
|
map <leader>F :Rg<CR>
|
||||||
|
|
||||||
|
nnoremap <leader>ca <cmd>lua vim.lsp.buf.code_action()<cr>
|
||||||
|
nnoremap <leader>gd <cmd>lua vim.lsp.buf.definition()<cr>
|
||||||
|
nnoremap <leader>gD <cmd>lua vim.lsp.buf.declaration()<cr>
|
||||||
|
nnoremap <leader>gr <cmd>lua vim.lsp.buf.references()<cr>
|
||||||
|
nnoremap <leader>rn <cmd>lua vim.lsp.buf.rename()<cr>
|
||||||
|
nnoremap <leader>K <cmd>lua vim.lsp.buf.hover()<cr>
|
||||||
|
|
||||||
|
nnoremap <leader>b :Buffers<cr>
|
||||||
|
|
||||||
|
nnoremap <C-L> :bnext<CR>
|
||||||
|
nnoremap <C-H> :bprevious<CR>
|
||||||
|
|
||||||
|
nnoremap <leader>J <cmd>lua vim.diagnostic.open_float()<cr>
|
||||||
|
nnoremap <M-F> <cmd>lua vim.lsp.buf.format({async = true})<cr>
|
||||||
|
inoremap <c-s> <cmd>lua vim.lsp.buf.signature_help()<cr>
|
||||||
|
|
||||||
|
nnoremap <F9> <cmd>lua require'dap'.toggle_breakpoint()<cr>
|
||||||
|
nnoremap <F5> <cmd>lua require'dap'.continue()<cr>
|
||||||
|
nnoremap <F10> <cmd>lua require'dap'.step_over()<cr>
|
||||||
|
nnoremap <F11> <cmd>lua require'dap'.step_into()<cr>
|
||||||
|
|
||||||
|
tnoremap <Esc><Esc> <C-\><C-n>
|
||||||
|
|
||||||
|
nnoremap <leader>td :ToDoTxtTasksToggle<cr>
|
||||||
|
|
||||||
|
autocmd BufWritePre *.ts lua vim.lsp.buf.formatting_sync(nil, 1000)
|
||||||
|
|
||||||
|
command JestRun :lua require'jester'.run({cmd = "npm run test -t '$result' -- $file"})
|
||||||
|
command JestRunFile :lua require'jester'.run_file({cmd = "npm run test -t '$result' -- $file"})
|
||||||
|
command JestRunLast :lua require'jester'.run_last({cmd = "npm run test -t '$result' -- $file"})
|
||||||
|
command JestDebug :lua require'jester'.debug({cmd = "npm run test -t '$result' -- $file"})
|
||||||
|
command JestDebugFile :lua require'jester'.debug_file({cmd = "npm run test -t '$result' -- $file"})
|
||||||
|
command JestDebugLast :lua require'jester'.debug_last({cmd = "npm run test -t '$result' -- $file"})
|
84
nvim/lua/cmp_config.lua
Normal file
84
nvim/lua/cmp_config.lua
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
|
local has_words_before = function()
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
|
end
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<C-k>'] = cmp.mapping.select_prev_item(),
|
||||||
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
|
['<C-j>'] = cmp.mapping.select_next_item(),
|
||||||
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||||
|
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||||
|
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||||
|
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||||
|
['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||||
|
['<C-e>'] = cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
}),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" })
|
||||||
|
},
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'nvim_lsp_signature_help' },
|
||||||
|
{ name = 'nvim_lua' },
|
||||||
|
{ name = 'buffer' },
|
||||||
|
{ name = 'luasnip' }, -- For luasnip users.
|
||||||
|
}),
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
fields = { 'menu', 'abbr', 'kind' },
|
||||||
|
format = function(entry, item)
|
||||||
|
local menu_icon = {
|
||||||
|
nvim_lsp = 'λ',
|
||||||
|
buffer = 'Ω'
|
||||||
|
}
|
||||||
|
item.menu = menu_icon[entry.source.name]
|
||||||
|
return item
|
||||||
|
end
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline('/', {
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, { { name = 'cmdline' } })
|
||||||
|
})
|
27
nvim/lua/dap_config.lua
Normal file
27
nvim/lua/dap_config.lua
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
vim.fn.sign_define('DapBreakpoint', {text='🟥', texthl='', linehl='', numhl=''})
|
||||||
|
vim.fn.sign_define('DapStopped', {text='⭐️', texthl='', linehl='', numhl=''})
|
||||||
|
local dap = require('dap')
|
||||||
|
dap.adapters.node2 = {
|
||||||
|
type = 'executable',
|
||||||
|
command = 'node',
|
||||||
|
args = {os.getenv('HOME') .. '/dev/microsoft/vscode-node-debug2/out/src/nodeDebug.js'},
|
||||||
|
}
|
||||||
|
dap.configurations.javascript = {
|
||||||
|
{
|
||||||
|
name = 'Launch',
|
||||||
|
type = 'node2',
|
||||||
|
request = 'launch',
|
||||||
|
program = '${file}',
|
||||||
|
cwd = vim.fn.getcwd(),
|
||||||
|
sourceMaps = true,
|
||||||
|
protocol = 'inspector',
|
||||||
|
console = 'integratedTerminal',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- For this to work you need to make sure the node process is started with the `--inspect` flag.
|
||||||
|
name = 'Attach to process',
|
||||||
|
type = 'node2',
|
||||||
|
request = 'attach',
|
||||||
|
processId = require'dap.utils'.pick_process,
|
||||||
|
},
|
||||||
|
}
|
51
nvim/lua/debugHelper.lua
Normal file
51
nvim/lua/debugHelper.lua
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
local dap = require('dap')
|
||||||
|
|
||||||
|
local function debugJest(testName, filename)
|
||||||
|
print("starting " .. testName .. " in " .. filename)
|
||||||
|
dap.run({
|
||||||
|
type = 'node2',
|
||||||
|
request = 'launch',
|
||||||
|
cwd = vim.fn.getcwd(),
|
||||||
|
runtimeArgs = {'--inspect-brk', '/usr/local/bin/jest', '--no-coverage', '-t', testName, '--', filename},
|
||||||
|
sourceMaps = true,
|
||||||
|
protocol = 'inspector',
|
||||||
|
skipFiles = {'<node_internals>/**/*.js'},
|
||||||
|
console = 'integratedTerminal',
|
||||||
|
port = 9229,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function attach()
|
||||||
|
print("attaching")
|
||||||
|
dap.run({
|
||||||
|
type = 'node2',
|
||||||
|
request = 'attach',
|
||||||
|
cwd = vim.fn.getcwd(),
|
||||||
|
sourceMaps = true,
|
||||||
|
protocol = 'inspector',
|
||||||
|
skipFiles = {'<node_internals>/**/*.js'},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function attachToRemote()
|
||||||
|
print("attaching")
|
||||||
|
dap.run({
|
||||||
|
type = 'node2',
|
||||||
|
request = 'attach',
|
||||||
|
address = "127.0.0.1",
|
||||||
|
port = 9229,
|
||||||
|
localRoot = vim.fn.getcwd(),
|
||||||
|
remoteRoot = "/home/vcap/app",
|
||||||
|
sourceMaps = true,
|
||||||
|
protocol = 'inspector',
|
||||||
|
skipFiles = {'<node_internals>/**/*.js'},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
debugJest = debugJest,
|
||||||
|
attach = attach,
|
||||||
|
attachToRemote = attachToRemote,
|
||||||
|
}
|
||||||
|
|
26
nvim/lua/globals_opts.lua
Normal file
26
nvim/lua/globals_opts.lua
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
local set = vim.opt
|
||||||
|
set.modelines = 0
|
||||||
|
set.hidden = true
|
||||||
|
set.number = true
|
||||||
|
set.ruler = true
|
||||||
|
set.visualbell = true
|
||||||
|
set.textwidth = 120
|
||||||
|
set.cursorline = true
|
||||||
|
set.tabstop = 2
|
||||||
|
set.shiftwidth = 2
|
||||||
|
set.showmode = true
|
||||||
|
set.showcmd = true
|
||||||
|
set.showmatch = true
|
||||||
|
set.hlsearch = true
|
||||||
|
set.ignorecase = true
|
||||||
|
set.smartcase = true
|
||||||
|
set.incsearch = true
|
||||||
|
set.wrapscan = true
|
||||||
|
set.scrolloff = 999
|
||||||
|
set.backspace = "indent,eol,start"
|
||||||
|
set.mouse = "nicr"
|
||||||
|
set.termguicolors = true
|
||||||
|
set.matchpairs:append("<:>")
|
||||||
|
set.completeopt = "menuone,noselect,preview"
|
||||||
|
set.expandtab = true
|
||||||
|
set.relativenumber = true
|
22
nvim/lua/jester.lua
Normal file
22
nvim/lua/jester.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
require'jester'.setup({
|
||||||
|
cmd = "yarn run test -t '$result' -- $file", -- run command
|
||||||
|
identifiers = {"test", "it"}, -- used to identify tests
|
||||||
|
prepend = {"describe"}, -- prepend describe blocks
|
||||||
|
expressions = {"call_expression"}, -- tree-sitter object used to scan for tests/describe blocks
|
||||||
|
path_to_jest_run = './node_modules/jest/bin/jest', -- used to run tests
|
||||||
|
path_to_jest_debug = './node_modules/jest/bin/jest', -- used for debugging
|
||||||
|
terminal_cmd = ":vsplit | terminal", -- used to spawn a terminal for running tests, for debugging refer to nvim-dap's config
|
||||||
|
dap = { -- debug adapter configuration
|
||||||
|
type = 'node2',
|
||||||
|
request = 'launch',
|
||||||
|
cwd = vim.fn.getcwd(),
|
||||||
|
runtimeArgs = {'--inspect-brk', '$path_to_jest', '--no-coverage', '-t', '$result', '--', '$file'},
|
||||||
|
args = { '--no-cache' },
|
||||||
|
sourceMaps = 'inline',
|
||||||
|
protocol = 'inspector',
|
||||||
|
skipFiles = {'<node_internals>/**/*.js'},
|
||||||
|
console = 'integratedTerminal',
|
||||||
|
port = 9229,
|
||||||
|
disableOptimisticBPs = true
|
||||||
|
}
|
||||||
|
})
|
44
nvim/lua/keymap.lua
Normal file
44
nvim/lua/keymap.lua
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
function map(mode, shortcut, command)
|
||||||
|
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
function nmap(shortcut, command)
|
||||||
|
map('n', shortcut, command)
|
||||||
|
end
|
||||||
|
|
||||||
|
function imap(shortcut, command)
|
||||||
|
map('i', shortcut, command)
|
||||||
|
end
|
||||||
|
|
||||||
|
function vmap(shortcut, command)
|
||||||
|
map('v', shortcut, command)
|
||||||
|
end
|
||||||
|
function xmap(shortcut, command)
|
||||||
|
map('x', shortcut, command)
|
||||||
|
end
|
||||||
|
|
||||||
|
nmap("<SPACE>","<Nop>")
|
||||||
|
nmap("<Esc><Esc>", ":noh<cr>")
|
||||||
|
|
||||||
|
|
||||||
|
nmap("<C-f>",":ToggleTerm direction=float<cr>")
|
||||||
|
imap("<C-f>",":ToggleTerm direction=float<cr>")
|
||||||
|
|
||||||
|
nmap("<C-l>",":ToggleTerm direction=horizontal size=10<cr>")
|
||||||
|
imap("<C-l>",":ToggleTerm direction=horizontal size=10<cr>")
|
||||||
|
|
||||||
|
xmap("p",'\"_dP')
|
||||||
|
nmap("<leader>fg", "<cmd>lua require('telescope.builtin').live_grep()<cr>")
|
||||||
|
nmap("<leader>fb", "<cmd>lua require('telescope.builtin').buffers()<cr>")
|
||||||
|
nmap("<leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<cr>")
|
||||||
|
nmap("<leader>ff", "<cmd>lua require('telescope.builtin').find_files()<cr>")
|
||||||
|
|
||||||
|
nmap("<leader>b","<cmd>lua require('telescope.builtin').buffers()<cr>")
|
||||||
|
nmap("<C-n>",":NvimTreeToggle<cr>")
|
||||||
|
nmap("<leader>r",":NvimTreeRefresh<cr>")
|
||||||
|
nmap("<leader>n",":NvimTreeToggle<cr>")
|
||||||
|
|
||||||
|
nmap("<leader>zn","zf%")
|
||||||
|
nmap("<leader>y",'\"+y')
|
||||||
|
vmap("<leader>y",'\"+y')
|
35
nvim/lua/lsp_conf.lua
Normal file
35
nvim/lua/lsp_conf.lua
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
local capabilites = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
|
||||||
|
require'lspconfig'.tsserver.setup{
|
||||||
|
capabilites = capabilites
|
||||||
|
}
|
||||||
|
require'lspconfig'.jsonls.setup{
|
||||||
|
capabilites = capabilites
|
||||||
|
}
|
||||||
|
require'lspconfig'.dockerls.setup{
|
||||||
|
capabilites = capabilites
|
||||||
|
}
|
||||||
|
require'lspconfig'.eslint.setup{
|
||||||
|
capabilites = capabilites,
|
||||||
|
settings= {
|
||||||
|
run = "onSave"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require'lspconfig'.gdscript.setup{
|
||||||
|
capabilites = capabilites
|
||||||
|
}
|
||||||
|
require'lspconfig'.gopls.setup{
|
||||||
|
capabilites = capabilites
|
||||||
|
}
|
||||||
|
require'lspconfig'.rust_analyzer.setup{
|
||||||
|
capabilites = capabilites
|
||||||
|
}
|
||||||
|
require'lspconfig'.cssls.setup{
|
||||||
|
capabilites = capabilites
|
||||||
|
}
|
||||||
|
require'lspconfig'.bashls.setup{
|
||||||
|
capabilites = capabilites
|
||||||
|
}
|
||||||
|
|
||||||
|
require'fzf_lsp'.setup()
|
||||||
|
|
25
nvim/lua/mason_config.lua
Normal file
25
nvim/lua/mason_config.lua
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
require('mason').setup({
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
package_installed = "✓",
|
||||||
|
package_pending = "➜",
|
||||||
|
package_uninstalled = "✗"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
require('mason-lspconfig').setup({
|
||||||
|
ensure_installed = {"tsserver"}
|
||||||
|
})
|
||||||
|
|
||||||
|
require'mason-tool-installer'.setup {
|
||||||
|
ensure_installed = {
|
||||||
|
{ 'bash-language-server', auto_update = true },
|
||||||
|
'lua-language-server',
|
||||||
|
'vim-language-server',
|
||||||
|
'stylua',
|
||||||
|
'json-to-struct',
|
||||||
|
},
|
||||||
|
auto_update = false,
|
||||||
|
run_on_start = true,
|
||||||
|
start_delay = 3000
|
||||||
|
}
|
6
nvim/lua/native_commands.lua
Normal file
6
nvim/lua/native_commands.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
vim.cmd('hi CursorLine term=bold cterm=bold ctermbg=darkgrey')
|
||||||
|
vim.cmd[[colorscheme tokyonight]]
|
||||||
|
vim.cmd([[
|
||||||
|
runtime macros/sandwich/keymap/surround.vim
|
||||||
|
]])
|
19
nvim/lua/neotest_config.lua
Normal file
19
nvim/lua/neotest_config.lua
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
require("neotest").setup({
|
||||||
|
adapters = {
|
||||||
|
require("neotest-jest")({
|
||||||
|
jestCommand = "npm test --",
|
||||||
|
jestConfigFile = "custom.jest.config.ts",
|
||||||
|
env = { CI = true },
|
||||||
|
cwd = function(path)
|
||||||
|
return vim.fn.getcwd()
|
||||||
|
end,
|
||||||
|
}),
|
||||||
|
require("neotest-python")({
|
||||||
|
dap = { justMyCode = false },
|
||||||
|
}),
|
||||||
|
require("neotest-plenary"),
|
||||||
|
require("neotest-vim-test")({
|
||||||
|
ignore_file_types = { "python", "vim", "lua" },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
106
nvim/lua/new_lsp_conf.lua
Normal file
106
nvim/lua/new_lsp_conf.lua
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||||
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||||
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||||
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||||
|
|
||||||
|
-- Use an on_attach function to only map the following keys
|
||||||
|
-- after the language server attaches to the current buffer
|
||||||
|
local on_attach = function(client, bufnr)
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
|
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
|
vim.keymap.set('n', '<leader>gD', vim.lsp.buf.declaration, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>K', vim.lsp.buf.hover, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>gi', vim.lsp.buf.implementation, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>k', vim.lsp.buf.signature_help, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>wl', function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>gr', vim.lsp.buf.references, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>f', vim.lsp.buf.format, bufopts)
|
||||||
|
end
|
||||||
|
|
||||||
|
local lsp_flags = {
|
||||||
|
-- This is the default in Nvim 0.7+
|
||||||
|
debounce_text_changes = 150,
|
||||||
|
}
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities(
|
||||||
|
vim.lsp.protocol.make_client_capabilities()
|
||||||
|
)
|
||||||
|
require('mason-lspconfig').setup_handlers {
|
||||||
|
function(server_name)
|
||||||
|
require('lspconfig')[server_name].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
['rust_analyzer'] = function()
|
||||||
|
local rustToolsOpts = {
|
||||||
|
tools = {
|
||||||
|
inlay_hints = {
|
||||||
|
auto = true,
|
||||||
|
only_current_line = false,
|
||||||
|
show_parameter_hints = true,
|
||||||
|
parameter_hints_prefix = "<-",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
server = {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
flags = lsp_flags,
|
||||||
|
settings = {
|
||||||
|
["rust_analyzer"] = {
|
||||||
|
checkOnSave = {
|
||||||
|
command = "clippy"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require('rust-tools').setup(rustToolsOpts)
|
||||||
|
--on_attach = on_attach,
|
||||||
|
--flags = lsp_flags,
|
||||||
|
require('lspconfig')['rust_analyzer'].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
-- server-specific settings...
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
['sumneko_lua'] = function()
|
||||||
|
require('lspconfig')["sumneko_lua"].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
--require('lspconfig')['rust_analyzer'].setup {
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
-- flags = lsp_flags,
|
||||||
|
-- -- Server-specific settings...
|
||||||
|
-- settings = {
|
||||||
|
-- ["rust-analyzer"] = {}
|
||||||
|
-- }
|
||||||
|
--}
|
9
nvim/lua/null-ls_config.lua
Normal file
9
nvim/lua/null-ls_config.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
require("null-ls").setup({
|
||||||
|
sources = {
|
||||||
|
|
||||||
|
--require("null-ls").builtins.formatting.stylua,
|
||||||
|
|
||||||
|
-- require("null-ls").builtins.diagnostics.eslint,
|
||||||
|
-- require("null-ls").builtins.completion.spell,
|
||||||
|
},
|
||||||
|
})
|
1
nvim/lua/nvim-lightbulb_config.lua
Normal file
1
nvim/lua/nvim-lightbulb_config.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
require('nvim-lightbulb').setup({ autocmd = { enabled = true } })
|
39
nvim/lua/nvimtest_config.lua
Normal file
39
nvim/lua/nvimtest_config.lua
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
require('nvim-test').setup {
|
||||||
|
run = true, -- run tests (using for debug)
|
||||||
|
commands_create = true, -- create commands (TestFile, TestLast, ...)
|
||||||
|
filename_modifier = ":.", -- modify filenames before tests run(:h filename-modifiers)
|
||||||
|
silent = false, -- less notifications
|
||||||
|
term = "terminal", -- a terminal to run ("terminal"|"toggleterm")
|
||||||
|
termOpts = {
|
||||||
|
direction = "vertical", -- terminal's direction ("horizontal"|"vertical"|"float")
|
||||||
|
width = 96, -- terminal's width (for vertical|float)
|
||||||
|
height = 24, -- terminal's height (for horizontal|float)
|
||||||
|
go_back = false, -- return focus to original window after executing
|
||||||
|
stopinsert = "auto", -- exit from insert mode (true|false|"auto")
|
||||||
|
keep_one = true, -- keep only one terminal for testing
|
||||||
|
},
|
||||||
|
runners = { -- setup tests runners
|
||||||
|
cs = "nvim-test.runners.dotnet",
|
||||||
|
go = "nvim-test.runners.go-test",
|
||||||
|
haskell = "nvim-test.runners.hspec",
|
||||||
|
javacriptreact = "nvim-test.runners.jest",
|
||||||
|
javascript = "nvim-test.runners.jest",
|
||||||
|
lua = "nvim-test.runners.busted",
|
||||||
|
python = "nvim-test.runners.pytest",
|
||||||
|
ruby = "nvim-test.runners.rspec",
|
||||||
|
rust = "nvim-test.runners.cargo-test",
|
||||||
|
typescript = "nvim-test.runners.jest",
|
||||||
|
typescriptreact = "nvim-test.runners.jest",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require('nvim-test.runners.jest'):setup {
|
||||||
|
command = "jest", -- a command to run the test runner
|
||||||
|
args = { "--collectCoverage=false" }, -- default arguments
|
||||||
|
env = { CUSTOM_VAR = 'value' }, -- custom environment variables
|
||||||
|
|
||||||
|
file_pattern = "\\v(__tests__/.*|(spec|test))\\.(js|jsx|coffee|ts|tsx)$", -- determine whether a file is a testfile
|
||||||
|
find_files = { "{name}.test.{ext}", "{name}.spec.{ext}" }, -- find testfile for a file
|
||||||
|
|
||||||
|
filename_modifier = nil, -- modify filename before tests run (:h filename-modifiers)
|
||||||
|
working_directory = nil, -- set working directory (cwd by default)
|
||||||
|
}
|
110
nvim/lua/nvimtree.lua
Normal file
110
nvim/lua/nvimtree.lua
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
require'nvim-tree'.setup {
|
||||||
|
renderer ={
|
||||||
|
icons = {
|
||||||
|
padding = ' ',
|
||||||
|
symlink_arrow = ' >> ',
|
||||||
|
show = {
|
||||||
|
git=true,
|
||||||
|
folder=true,
|
||||||
|
file=true,
|
||||||
|
folder_arrow= false
|
||||||
|
},
|
||||||
|
glyphs = {
|
||||||
|
default= "",
|
||||||
|
symlink= "",
|
||||||
|
git= {
|
||||||
|
unstaged= "✗",
|
||||||
|
staged= "✓",
|
||||||
|
unmerged= "",
|
||||||
|
renamed= "➜",
|
||||||
|
untracked= "★",
|
||||||
|
deleted= "",
|
||||||
|
ignored= "◌"
|
||||||
|
},
|
||||||
|
folder= {
|
||||||
|
arrow_open= "",
|
||||||
|
arrow_closed= "",
|
||||||
|
default= "",
|
||||||
|
open= "",
|
||||||
|
empty= "",
|
||||||
|
empty_open= "",
|
||||||
|
symlink= "",
|
||||||
|
symlink_open= "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
add_trailing = true,
|
||||||
|
highlight_opened_files = "all",
|
||||||
|
root_folder_modifier = ':~',
|
||||||
|
special_files = {
|
||||||
|
'README.md',
|
||||||
|
'Makefile',
|
||||||
|
'MAKEFILE'
|
||||||
|
},
|
||||||
|
highlight_git = true,
|
||||||
|
indent_markers = {
|
||||||
|
enable = true,
|
||||||
|
icons = {
|
||||||
|
corner = "└",
|
||||||
|
edge = "│ ",
|
||||||
|
none = " ",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
respect_buf_cwd = true,
|
||||||
|
disable_netrw = true,
|
||||||
|
hijack_netrw = true,
|
||||||
|
open_on_setup = false,
|
||||||
|
ignore_ft_on_setup = {},
|
||||||
|
open_on_tab = false,
|
||||||
|
hijack_cursor = true,
|
||||||
|
auto_reload_on_write = true,
|
||||||
|
update_cwd = false,
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
icons = {
|
||||||
|
hint = "",
|
||||||
|
info = "",
|
||||||
|
warning = "",
|
||||||
|
error = "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
update_cwd = true,
|
||||||
|
ignore_list = {}
|
||||||
|
},
|
||||||
|
system_open = {
|
||||||
|
cmd = nil,
|
||||||
|
args = {}
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
custom = {}
|
||||||
|
},
|
||||||
|
git={
|
||||||
|
ignore = false,
|
||||||
|
enable= true,
|
||||||
|
timeout=500,
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
open_file = {
|
||||||
|
resize_window = false,
|
||||||
|
window_picker = {
|
||||||
|
exclude = {
|
||||||
|
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||||
|
buftype = { "nofile","terminal","help" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
width = 35,
|
||||||
|
hide_root_folder = false,
|
||||||
|
side = 'left',
|
||||||
|
mappings = {
|
||||||
|
custom_only = false,
|
||||||
|
list = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
94
nvim/lua/plugins.lua
Normal file
94
nvim/lua/plugins.lua
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
require("packer").startup(function(use)
|
||||||
|
use("wbthomason/packer.nvim")
|
||||||
|
use({
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||||
|
})
|
||||||
|
use("mfussenegger/nvim-dap")
|
||||||
|
use("jose-elias-alvarez/null-ls.nvim")
|
||||||
|
use({
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
tag = "0.1.0",
|
||||||
|
requires = { { "nvim-lua/plenary.nvim" } },
|
||||||
|
})
|
||||||
|
use("nvim-lua/lsp-status.nvim")
|
||||||
|
use("jiangmiao/auto-pairs")
|
||||||
|
use("machakann/vim-sandwich")
|
||||||
|
use("machakann/vim-highlightedyank")
|
||||||
|
use("bling/vim-airline")
|
||||||
|
use("airblade/vim-gitgutter")
|
||||||
|
use("easymotion/vim-easymotion")
|
||||||
|
use({
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"kosayoda/nvim-lightbulb",
|
||||||
|
})
|
||||||
|
use("hrsh7th/cmp-nvim-lsp")
|
||||||
|
use("hrsh7th/cmp-nvim-lsp-signature-help")
|
||||||
|
use("hrsh7th/cmp-nvim-lua")
|
||||||
|
use("hrsh7th/cmp-buffer")
|
||||||
|
use("hrsh7th/cmp-path")
|
||||||
|
use("hrsh7th/cmp-vsnip")
|
||||||
|
use("hrsh7th/vim-vsnip")
|
||||||
|
use("hrsh7th/nvim-cmp")
|
||||||
|
use("hrsh7th/cmp-cmdline")
|
||||||
|
use("saadparwaiz1/cmp_luasnip")
|
||||||
|
use("L3MON4D3/LuaSnip")
|
||||||
|
use("kyazdani42/nvim-web-devicons")
|
||||||
|
use("kyazdani42/nvim-tree.lua")
|
||||||
|
use("tpope/vim-fugitive")
|
||||||
|
use({
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
run = function()
|
||||||
|
require("nvim-treesitter.install").update({ with_sync = true })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use("folke/tokyonight.nvim")
|
||||||
|
use("simrat39/rust-tools.nvim")
|
||||||
|
use({
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
tag = "v2.*",
|
||||||
|
config = function()
|
||||||
|
require("toggleterm").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use("https://git.sr.ht/~whynothugo/lsp_lines.nvim")
|
||||||
|
--use 'morhetz/gruvbox'
|
||||||
|
use({
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
config = function()
|
||||||
|
require("which-key").setup({})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use("gbrlsnchs/telescope-lsp-handlers.nvim")
|
||||||
|
use({
|
||||||
|
"klen/nvim-test",
|
||||||
|
config = function()
|
||||||
|
require("nvim-test").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
requires = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"haydenmeade/neotest-jest",
|
||||||
|
"nvim-neotest/neotest-python",
|
||||||
|
"nvim-neotest/neotest-plenary",
|
||||||
|
"nvim-neotest/neotest-vim-test",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"MunifTanjim/prettier.nvim",
|
||||||
|
requires = {
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
use {
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
requires = "kyazdani42/nvim-web-devicons"
|
||||||
|
}
|
||||||
|
end)
|
10
nvim/lua/telescope_config.lua
Normal file
10
nvim/lua/telescope_config.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
require('telescope').load_extension('lsp_handlers')
|
||||||
|
require('telescope').setup({
|
||||||
|
extensions = {
|
||||||
|
lsp_handlers = {
|
||||||
|
code_action = {
|
||||||
|
telescope = require('telescope.themes').get_dropdown({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
9
nvim/lua/todotxt_config.lua
Normal file
9
nvim/lua/todotxt_config.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
todo = require('todotxt-nvim')
|
||||||
|
todo.setup({
|
||||||
|
todo_file = '~/todotxt/todo.txt',
|
||||||
|
sidebar = {
|
||||||
|
width = 40,
|
||||||
|
position = 'right'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
13
nvim/lua/toggleterm_config.lua
Normal file
13
nvim/lua/toggleterm_config.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
require"toggleterm".setup{
|
||||||
|
open_mapping = [[<c-y>]],
|
||||||
|
hide_numbers = true,
|
||||||
|
--direction = 'float',
|
||||||
|
float_opts = {
|
||||||
|
border = 'curved'
|
||||||
|
},
|
||||||
|
winbar = {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
38
nvim/lua/treesitter_config.lua
Normal file
38
nvim/lua/treesitter_config.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||||
|
ensure_installed = "all",
|
||||||
|
|
||||||
|
-- Install languages synchronously (only applied to `ensure_installed`)
|
||||||
|
sync_install = false,
|
||||||
|
|
||||||
|
-- List of parsers to ignore installing
|
||||||
|
ignore_install = { },
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
-- `false` will disable the whole extension
|
||||||
|
enable = true,
|
||||||
|
|
||||||
|
-- list of language that will be disabled
|
||||||
|
disable = { },
|
||||||
|
|
||||||
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||||
|
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||||
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||||
|
-- Instead of true it can also be a list of languages
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
--- Treesitter
|
||||||
|
---BEGINWORKAROUND
|
||||||
|
--vim.api.nvim_create_autocmd({'BufEnter','BufAdd','BufNew','BufNewFile','BufWinEnter'}, {
|
||||||
|
-- group = vim.api.nvim_create_augroup('TS_FOLD_WORKAROUND', {}),
|
||||||
|
-- callback = function()
|
||||||
|
-- vim.opt.foldmethod = 'expr'
|
||||||
|
-- vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
|
-- end
|
||||||
|
--})
|
||||||
|
---ENDWORKAROUND
|
||||||
|
--- Treesitter
|
||||||
|
--- Utility functions
|
||||||
|
---
|
75
nvim/lua/trouble_config.lua
Normal file
75
nvim/lua/trouble_config.lua
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
require('trouble').setup {
|
||||||
|
position = "bottom", -- position of the list can be: bottom, top, left, right
|
||||||
|
height = 10, -- height of the trouble list when position is top or bottom
|
||||||
|
width = 50, -- width of the list when position is left or right
|
||||||
|
icons = true, -- use devicons for filenames
|
||||||
|
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
|
||||||
|
fold_open = "", -- icon used for open folds
|
||||||
|
fold_closed = "", -- icon used for closed folds
|
||||||
|
group = true, -- group results by file
|
||||||
|
padding = true, -- add an extra new line on top of the list
|
||||||
|
action_keys = { -- key mappings for actions in the trouble list
|
||||||
|
-- map to {} to remove a mapping, for example:
|
||||||
|
-- close = {},
|
||||||
|
close = "q", -- close the list
|
||||||
|
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
|
||||||
|
refresh = "r", -- manually refresh
|
||||||
|
jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds
|
||||||
|
open_split = { "<c-x>" }, -- open buffer in new split
|
||||||
|
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
|
||||||
|
open_tab = { "<c-t>" }, -- open buffer in new tab
|
||||||
|
jump_close = { "o" }, -- jump to the diagnostic and close the list
|
||||||
|
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
|
||||||
|
toggle_preview = "P", -- toggle auto_preview
|
||||||
|
hover = "K", -- opens a small popup with the full multiline message
|
||||||
|
preview = "p", -- preview the diagnostic location
|
||||||
|
close_folds = { "zM", "zm" }, -- close all folds
|
||||||
|
open_folds = { "zR", "zr" }, -- open all folds
|
||||||
|
toggle_fold = { "zA", "za" }, -- toggle fold of current file
|
||||||
|
previous = "k", -- previous item
|
||||||
|
next = "j" -- next item
|
||||||
|
},
|
||||||
|
indent_lines = true, -- add an indent guide below the fold icons
|
||||||
|
auto_open = false, -- automatically open the list when you have diagnostics
|
||||||
|
auto_close = false, -- automatically close the list when you have no diagnostics
|
||||||
|
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
|
||||||
|
auto_fold = false, -- automatically fold a file trouble list at creation
|
||||||
|
auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
|
||||||
|
signs = {
|
||||||
|
-- icons / text used for a diagnostic
|
||||||
|
error = "",
|
||||||
|
warning = "",
|
||||||
|
hint = "",
|
||||||
|
information = "",
|
||||||
|
other = ""
|
||||||
|
},
|
||||||
|
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
|
||||||
|
}
|
||||||
|
vim.keymap.set("n", "<leader>t", "<cmd>TroubleToggle<cr>",
|
||||||
|
{ silent = true, noremap = true }
|
||||||
|
)
|
||||||
|
vim.keymap.set("n", "<leader>tw", "<cmd>TroubleToggle workspace_diagnostics<cr>",
|
||||||
|
{ silent = true, noremap = true }
|
||||||
|
)
|
||||||
|
vim.keymap.set("n", "<leader>td", "<cmd>TroubleToggle document_diagnostics<cr>",
|
||||||
|
{ silent = true, noremap = true }
|
||||||
|
)
|
||||||
|
vim.keymap.set("n", "<leader>tl", "<cmd>TroubleToggle loclist<cr>",
|
||||||
|
{ silent = true, noremap = true }
|
||||||
|
)
|
||||||
|
vim.keymap.set("n", "<leader>tq", "<cmd>TroubleToggle quickfix<cr>",
|
||||||
|
{ silent = true, noremap = true }
|
||||||
|
)
|
||||||
|
|
||||||
|
local trouble = require("trouble.providers.telescope")
|
||||||
|
|
||||||
|
local telescope = require("telescope")
|
||||||
|
|
||||||
|
telescope.setup {
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = { ["<c-t>"] = trouble.open_with_trouble },
|
||||||
|
n = { ["<c-t>"] = trouble.open_with_trouble },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
9
nvim/lua/virtual_lines_config.lua
Normal file
9
nvim/lua/virtual_lines_config.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
lines = require('lsp_lines')
|
||||||
|
lines.setup()
|
||||||
|
vim.diagnostic.config({ virtual_text = false });
|
||||||
|
vim.keymap.set(
|
||||||
|
"",
|
||||||
|
"tl",
|
||||||
|
lines.toggle,
|
||||||
|
{ desc = "Toggle lsp_lines" }
|
||||||
|
);
|
@ -1,5 +1,5 @@
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
RUN apk add --update git && apk add --update openssh
|
#RUN apk add --update git && apk add --update openssh
|
||||||
RUN git clone https://github.com/mightypanders/dotfiles.git
|
#RUN git clone https://github.com/mightypanders/dotfiles.git
|
||||||
WORKDIR /dotfiles/startpage
|
#WORKDIR /dotfiles/startpage
|
||||||
COPY . /usr/share/nginx/html
|
COPY . /usr/share/nginx/html
|
||||||
|
@ -1,2 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
docker build -t local_startpage:latest .
|
REPO="startpage"
|
||||||
|
docker build -t $REPO:latest .
|
||||||
|
docker tag $REPO:latest registry.brudi.xyz/$REPO:latest
|
||||||
|
docker push registry.brudi.xyz/$REPO:latest
|
||||||
|
@ -42,15 +42,11 @@ var sites = {
|
|||||||
Work: {
|
Work: {
|
||||||
gitlab: "https://gitlab.com/nutmountain/landgard?sort=updated_desc",
|
gitlab: "https://gitlab.com/nutmountain/landgard?sort=updated_desc",
|
||||||
"enfore api docs": "https://docs.apis.enfore.com/",
|
"enfore api docs": "https://docs.apis.enfore.com/",
|
||||||
"n4 daily":
|
|
||||||
"https://zoom.us/j/274186354?pwd=Z29yamZaZ3dHV2ZOM1o2UkVHVUdpQT09",
|
|
||||||
apex:
|
apex:
|
||||||
"https://18.185.159.119:8443/ords/f?p=123:LOGIN_DESKTOP:15410784571178:::::",
|
"https://18.185.159.119:8443/ords/f?p=123:LOGIN_DESKTOP:15410784571178:::::",
|
||||||
aws:
|
aws:
|
||||||
"https://us-east-1.signin.aws.amazon.com/oauth?SignatureVersion=4&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJMOATPLHVSJ563XQ&X-Amz-Date=2019-10-15T15%3A01%3A16.654Z&X-Amz-Signature=5cd9c455e673d043421f5bc47b87c61a438cd5b85d808f85e6b3304f0ef6c2de&X-Amz-SignedHeaders=host&client_id=arn%3Aaws%3Aiam%3A%3A015428540659%3Auser%2Fhomepage&redirect_uri=https%3A%2F%2Fconsole.aws.amazon.com%2Fconsole%2Fhome%3Fstate%3DhashArgs%2523%26isauthcode%3Dtrue&response_type=code&state=hashArgs%23",
|
"https://us-east-1.signin.aws.amazon.com/oauth?SignatureVersion=4&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJMOATPLHVSJ563XQ&X-Amz-Date=2019-10-15T15%3A01%3A16.654Z&X-Amz-Signature=5cd9c455e673d043421f5bc47b87c61a438cd5b85d808f85e6b3304f0ef6c2de&X-Amz-SignedHeaders=host&client_id=arn%3Aaws%3Aiam%3A%3A015428540659%3Auser%2Fhomepage&redirect_uri=https%3A%2F%2Fconsole.aws.amazon.com%2Fconsole%2Fhome%3Fstate%3DhashArgs%2523%26isauthcode%3Dtrue&response_type=code&state=hashArgs%23",
|
||||||
"rc-intranet": "https://realcorevv.sharepoint.com/sites/RC-Intranet/",
|
"rc-intranet": "https://realcorevv.sharepoint.com/sites/RC-Intranet/",
|
||||||
food:
|
|
||||||
"https://www.rge-essen.de/dienstleistungen/gastronomie/speiseplaene.html",
|
|
||||||
},
|
},
|
||||||
Social: {
|
Social: {
|
||||||
WhatsApp: "https://web.whatsapp.com",
|
WhatsApp: "https://web.whatsapp.com",
|
||||||
@ -59,16 +55,7 @@ var sites = {
|
|||||||
YouTube: "https://www.youtube.com/",
|
YouTube: "https://www.youtube.com/",
|
||||||
threema: "https://web.threema.ch",
|
threema: "https://web.threema.ch",
|
||||||
},
|
},
|
||||||
/* "Games": { // To find the game ID check the url in the store page or the community page
|
|
||||||
"CS:GO" : "steam://run/730",
|
|
||||||
"Besiege" : "steam://run/346010",
|
|
||||||
"Rust" : "steam://run/252490",
|
|
||||||
"Insurgency" : "steam://run/222880",
|
|
||||||
"West of Loathing" : "steam://run/597220",
|
|
||||||
"POSTAL 2" : "steam://run/223470"
|
|
||||||
},*/
|
|
||||||
News: {
|
News: {
|
||||||
worldnews: "https://reddit.com/r/worldnews",
|
|
||||||
golem: "https://www.golem.de/",
|
golem: "https://www.golem.de/",
|
||||||
heise: "https://www.heise.de/",
|
heise: "https://www.heise.de/",
|
||||||
WAZ: "http://www.waz.de",
|
WAZ: "http://www.waz.de",
|
||||||
@ -87,21 +74,29 @@ var sites = {
|
|||||||
sffpc: "https://reddit.com/r/sffpc",
|
sffpc: "https://reddit.com/r/sffpc",
|
||||||
unixporn: "https://reddit.com/r/unixporn",
|
unixporn: "https://reddit.com/r/unixporn",
|
||||||
games: "https://reddit.com/r/games",
|
games: "https://reddit.com/r/games",
|
||||||
switchhaxing: "https://reddit.com/r/switchhaxing",
|
switchhacking: "https://reddit.com/r/switchhaxing+switchhacks",
|
||||||
switchhacks: "https://reddit.com/r/switchhacks",
|
|
||||||
},
|
},
|
||||||
brudi: {
|
hosted: {
|
||||||
heimdall: "http://brudi.xyz",
|
yavin: "http://yavin:8181",
|
||||||
gitea: "http://gitea.brudi.xyz",
|
gitea: "http://gitea.brudi.xyz",
|
||||||
etherpad: "http://pad.brudi.xyz",
|
|
||||||
send: "http://send.brudi.xyz",
|
send: "http://send.brudi.xyz",
|
||||||
kanban: "http://kanboard.brudi.xyz",
|
kanban: "http://kanboard.brudi.xyz",
|
||||||
pics: "http://pics.brudi.xyz",
|
media: "https://media.hartzarett.ruhr"
|
||||||
|
},
|
||||||
|
Games: {
|
||||||
|
// To find the game ID check the url in the store page or the community page
|
||||||
|
"CS:GO": "steam://run/730",
|
||||||
|
"Lost Ark": "steam://run/1599340",
|
||||||
|
"Golf It!": "steam://run/571740",
|
||||||
|
PUBG: "steam://run/578080",
|
||||||
|
// "West of Loathing": "steam://run/597220",
|
||||||
|
// "POSTAL 2": "steam://run/223470",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
var search = {
|
var search = {
|
||||||
default: "https://google.com/search",
|
default: "https://duckduckgo.com/",
|
||||||
|
g: "https://google.com/search",
|
||||||
d: "https://duckduckgo.com/",
|
d: "https://duckduckgo.com/",
|
||||||
s: "https://startpage.com/do/search",
|
s: "https://startpage.com/do/search",
|
||||||
};
|
};
|
||||||
|
3
systemd/targets/wayland-session.target
Normal file
3
systemd/targets/wayland-session.target
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Wayland Session managed by systemd
|
||||||
|
BindsTo=graphical-session.target
|
24
vim/.vimrc
24
vim/.vimrc
@ -1,5 +1,6 @@
|
|||||||
syntax on
|
syntax on
|
||||||
set modelines=0
|
set modelines=0
|
||||||
|
set hidden
|
||||||
set number
|
set number
|
||||||
set ruler
|
set ruler
|
||||||
set visualbell
|
set visualbell
|
||||||
@ -25,25 +26,10 @@ nnoremap <SPACE> <Nop>
|
|||||||
let mapleader=" "
|
let mapleader=" "
|
||||||
"mappings
|
"mappings
|
||||||
map <leader>h :set cursorline!<CR>
|
map <leader>h :set cursorline!<CR>
|
||||||
|
"map <leader>c :!yarn copy-start<CR>
|
||||||
|
"map <leader>b :!yarn build<CR>
|
||||||
|
"map <leader>bs :!yarn build-start<CR>
|
||||||
|
|
||||||
xnoremap p "_dP
|
xnoremap p "_dP
|
||||||
nnoremap <esc><esc> :noh<return><esc>
|
nnoremap <esc><esc> :noh<return><esc>
|
||||||
|
|
||||||
if has('nvim')
|
|
||||||
call plug#begin(stdpath('data') . '/plugged')
|
|
||||||
Plug 'junegunn/vim-easy-align'
|
|
||||||
Plug 'morhetz/gruvbox'
|
|
||||||
Plug 'Shougo/deoplete.nvim', {'do':':UpdateRemotePlugins'}
|
|
||||||
Plug 'junegunn/fzf', {'do': {->fzf#install()}}
|
|
||||||
Plug 'jiangmiao/auto-pairs'
|
|
||||||
Plug 'machakann/vim-sandwich'
|
|
||||||
Plug 'machakann/vim-highlightedyank'
|
|
||||||
Plug 'bling/vim-airline'
|
|
||||||
Plug 'airblade/vim-gitgutter'
|
|
||||||
Plug 'rhysd/vim-clang-format'
|
|
||||||
Plug 'easymotion/vim-easymotion'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
autocmd vimenter * colorscheme gruvbox
|
|
||||||
let g:deoplete#enable_at_startup = 1
|
|
||||||
let g:clang_format#auto_format=1
|
|
||||||
endif
|
|
||||||
|
236
vim/init.vim
Normal file
236
vim/init.vim
Normal file
@ -0,0 +1,236 @@
|
|||||||
|
" Specify a directory for plugins
|
||||||
|
call plug#begin('~/.vim/plugged')
|
||||||
|
|
||||||
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
|
Plug 'scrooloose/nerdtree'
|
||||||
|
"Plug 'tsony-tsonev/nerdtree-git-plugin'
|
||||||
|
Plug 'Xuyuanp/nerdtree-git-plugin'
|
||||||
|
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||||
|
Plug 'ryanoasis/vim-devicons'
|
||||||
|
Plug 'airblade/vim-gitgutter'
|
||||||
|
Plug 'ctrlpvim/ctrlp.vim' " fuzzy find files
|
||||||
|
Plug 'scrooloose/nerdcommenter'
|
||||||
|
"Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
|
||||||
|
|
||||||
|
Plug 'christoomey/vim-tmux-navigator'
|
||||||
|
|
||||||
|
Plug 'morhetz/gruvbox'
|
||||||
|
|
||||||
|
Plug 'HerringtonDarkholme/yats.vim' " TS Syntax
|
||||||
|
|
||||||
|
" Initialize plugin system
|
||||||
|
call plug#end()
|
||||||
|
let mapleader = ","
|
||||||
|
|
||||||
|
inoremap jk <ESC>
|
||||||
|
nmap <C-n> :NERDTreeToggle<CR>
|
||||||
|
vmap ++ <plug>NERDCommenterToggle
|
||||||
|
nmap ++ <plug>NERDCommenterToggle
|
||||||
|
nnoremap <esc> :noh<return><esc>
|
||||||
|
|
||||||
|
|
||||||
|
" open NERDTree automatically
|
||||||
|
"autocmd StdinReadPre * let s:std_in=1
|
||||||
|
"autocmd VimEnter * NERDTree
|
||||||
|
|
||||||
|
let g:NERDTreeGitStatusWithFlags = 1
|
||||||
|
"let g:WebDevIconsUnicodeDecorateFolderNodes = 1
|
||||||
|
"let g:NERDTreeGitStatusNodeColorization = 1
|
||||||
|
"let g:NERDTreeColorMapCustom = {
|
||||||
|
"\ "Staged" : "#0ee375",
|
||||||
|
"\ "Modified" : "#d9bf91",
|
||||||
|
"\ "Renamed" : "#51C9FC",
|
||||||
|
"\ "Untracked" : "#FCE77C",
|
||||||
|
"\ "Unmerged" : "#FC51E6",
|
||||||
|
"\ "Dirty" : "#FFBD61",
|
||||||
|
"\ "Clean" : "#87939A",
|
||||||
|
"\ "Ignored" : "#808080"
|
||||||
|
"\ }
|
||||||
|
|
||||||
|
|
||||||
|
let g:NERDTreeIgnore = ['^node_modules$']
|
||||||
|
|
||||||
|
" vim-prettier
|
||||||
|
"let g:prettier#quickfix_enabled = 0
|
||||||
|
"let g:prettier#quickfix_auto_focus = 0
|
||||||
|
" prettier command for coc
|
||||||
|
command! -nargs=0 Prettier :CocCommand prettier.formatFile
|
||||||
|
" run prettier on save
|
||||||
|
"let g:prettier#autoformat = 0
|
||||||
|
"autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
|
||||||
|
|
||||||
|
|
||||||
|
" ctrlp
|
||||||
|
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
|
||||||
|
|
||||||
|
" j/k will move virtual lines (lines that wrap)
|
||||||
|
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
|
||||||
|
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
|
||||||
|
|
||||||
|
set number
|
||||||
|
set relativenumber
|
||||||
|
|
||||||
|
set hlsearch
|
||||||
|
set incsearch
|
||||||
|
set wrapscan
|
||||||
|
set scrolloff=999
|
||||||
|
set smartcase
|
||||||
|
|
||||||
|
set smarttab
|
||||||
|
set cindent
|
||||||
|
set tabstop=2
|
||||||
|
set shiftwidth=2
|
||||||
|
" always uses spaces instead of tab characters
|
||||||
|
set expandtab
|
||||||
|
|
||||||
|
colorscheme gruvbox
|
||||||
|
set background=dark
|
||||||
|
let g:gruvbox_contrast_dark = 'medium'
|
||||||
|
|
||||||
|
" sync open file with NERDTree
|
||||||
|
" " Check if NERDTree is open or active
|
||||||
|
function! IsNERDTreeOpen()
|
||||||
|
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Call NERDTreeFind iff NERDTree is active, current window contains a modifiable
|
||||||
|
" file, and we're not in vimdiff
|
||||||
|
function! SyncTree()
|
||||||
|
if &modifiable && IsNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff
|
||||||
|
NERDTreeFind
|
||||||
|
wincmd p
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Highlight currently open buffer in NERDTree
|
||||||
|
autocmd BufEnter * call SyncTree()
|
||||||
|
|
||||||
|
" coc config
|
||||||
|
let g:coc_global_extensions = [
|
||||||
|
\ 'coc-snippets',
|
||||||
|
\ 'coc-pairs',
|
||||||
|
\ 'coc-tsserver',
|
||||||
|
\ 'coc-eslint',
|
||||||
|
\ 'coc-prettier',
|
||||||
|
\ 'coc-json',
|
||||||
|
\ ]
|
||||||
|
" from readme
|
||||||
|
" if hidden is not set, TextEdit might fail.
|
||||||
|
set hidden " Some servers have issues with backup files, see #649 set nobackup set nowritebackup " Better display for messages set cmdheight=2 " You will have bad experience for diagnostic messages when it's default 4000.
|
||||||
|
set updatetime=300
|
||||||
|
|
||||||
|
" don't give |ins-completion-menu| messages.
|
||||||
|
set shortmess+=c
|
||||||
|
|
||||||
|
" always show signcolumns
|
||||||
|
set signcolumn=yes
|
||||||
|
|
||||||
|
" Use tab for trigger completion with characters ahead and navigate.
|
||||||
|
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ pumvisible() ? "\<C-n>" :
|
||||||
|
\ <SID>check_back_space() ? "\<TAB>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||||
|
|
||||||
|
function! s:check_back_space() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Use <c-space> to trigger completion.
|
||||||
|
inoremap <silent><expr> <c-space> coc#refresh()
|
||||||
|
|
||||||
|
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
|
||||||
|
" Coc only does snippet and additional edit on confirm.
|
||||||
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
|
" Or use `complete_info` if your vim support it, like:
|
||||||
|
" inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
|
|
||||||
|
" Use `[g` and `]g` to navigate diagnostics
|
||||||
|
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
||||||
|
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
||||||
|
|
||||||
|
" Remap keys for gotos
|
||||||
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
|
nmap <silent> gy <Plug>(coc-type-definition)
|
||||||
|
nmap <silent> gi <Plug>(coc-implementation)
|
||||||
|
nmap <silent> gr <Plug>(coc-references)
|
||||||
|
|
||||||
|
" Use K to show documentation in preview window
|
||||||
|
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||||
|
|
||||||
|
function! s:show_documentation()
|
||||||
|
if (index(['vim','help'], &filetype) >= 0)
|
||||||
|
execute 'h '.expand('<cword>')
|
||||||
|
else
|
||||||
|
call CocAction('doHover')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Highlight symbol under cursor on CursorHold
|
||||||
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||||
|
|
||||||
|
" Remap for rename current word
|
||||||
|
nmap <F2> <Plug>(coc-rename)
|
||||||
|
|
||||||
|
" Remap for format selected region
|
||||||
|
xmap <leader>f <Plug>(coc-format-selected)
|
||||||
|
nmap <leader>f <Plug>(coc-format-selected)
|
||||||
|
|
||||||
|
augroup mygroup
|
||||||
|
autocmd!
|
||||||
|
" Setup formatexpr specified filetype(s).
|
||||||
|
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
|
||||||
|
" Update signature help on jump placeholder
|
||||||
|
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
||||||
|
augroup end
|
||||||
|
|
||||||
|
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
|
||||||
|
xmap <leader>a <Plug>(coc-codeaction-selected)
|
||||||
|
nmap <leader>a <Plug>(coc-codeaction-selected)
|
||||||
|
|
||||||
|
" Remap for do codeAction of current line
|
||||||
|
nmap <leader>ac <Plug>(coc-codeaction)
|
||||||
|
" Fix autofix problem of current line
|
||||||
|
nmap <leader>qf <Plug>(coc-fix-current)
|
||||||
|
|
||||||
|
" Create mappings for function text object, requires document symbols feature of languageserver.
|
||||||
|
xmap if <Plug>(coc-funcobj-i)
|
||||||
|
xmap af <Plug>(coc-funcobj-a)
|
||||||
|
omap if <Plug>(coc-funcobj-i)
|
||||||
|
omap af <Plug>(coc-funcobj-a)
|
||||||
|
|
||||||
|
" Use <C-d> for select selections ranges, needs server support, like: coc-tsserver, coc-python
|
||||||
|
nmap <silent> <C-d> <Plug>(coc-range-select)
|
||||||
|
xmap <silent> <C-d> <Plug>(coc-range-select)
|
||||||
|
|
||||||
|
" Use `:Format` to format current buffer
|
||||||
|
command! -nargs=0 Format :call CocAction('format')
|
||||||
|
|
||||||
|
" Use `:Fold` to fold current buffer
|
||||||
|
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
||||||
|
|
||||||
|
" use `:OR` for organize import of current buffer
|
||||||
|
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
||||||
|
|
||||||
|
" Add status line support, for integration with other plugin, checkout `:h coc-status`
|
||||||
|
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
||||||
|
|
||||||
|
" Using CocList
|
||||||
|
" Show all diagnostics
|
||||||
|
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
||||||
|
" Manage extensions
|
||||||
|
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
|
||||||
|
" Show commands
|
||||||
|
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
||||||
|
" Find symbol of current document
|
||||||
|
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
|
||||||
|
" Search workspace symbols
|
||||||
|
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
||||||
|
" Do default action for next item.
|
||||||
|
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
||||||
|
" Do default action for previous item.
|
||||||
|
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
||||||
|
" Resume latest coc list
|
||||||
|
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
3
vim/init.vim.new
Normal file
3
vim/init.vim.new
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
set runtimepath^=/.vim runtimepath+=~/.vim/after
|
||||||
|
let &packpath = &runtimepath
|
||||||
|
source ~/.vimrc
|
Loading…
Reference in New Issue
Block a user