diff --git a/startpage/dome.js b/startpage/dome.js index e4ace9c..4058a1f 100755 --- a/startpage/dome.js +++ b/startpage/dome.js @@ -42,8 +42,6 @@ var sites = { Work: { gitlab: "https://gitlab.com/nutmountain/landgard?sort=updated_desc", "enfore api docs": "https://docs.apis.enfore.com/", - "n4 daily": - "https://zoom.us/j/274186354?pwd=Z29yamZaZ3dHV2ZOM1o2UkVHVUdpQT09", apex: "https://18.185.159.119:8443/ords/f?p=123:LOGIN_DESKTOP:15410784571178:::::", aws: @@ -79,8 +77,7 @@ var sites = { sffpc: "https://reddit.com/r/sffpc", unixporn: "https://reddit.com/r/unixporn", games: "https://reddit.com/r/games", - switchhaxing: "https://reddit.com/r/switchhaxing", - switchhacks: "https://reddit.com/r/switchhacks", + switchhacking: "https://reddit.com/r/switchhaxing+switchhacks", }, brudi: { heimdall: "http://brudi.xyz", diff --git a/vim/.vimrc b/vim/.vimrc index 0a678e0..3fad700 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,5 +1,6 @@ syntax on set modelines=0 +set hidden set number set ruler set visualbell @@ -25,6 +26,10 @@ nnoremap let mapleader=" " "mappings map h :set cursorline! +"map c :!yarn copy-start +"map b :!yarn build +"map bs :!yarn build-start + xnoremap p "_dP nnoremap :noh @@ -32,8 +37,10 @@ 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 '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' @@ -41,9 +48,248 @@ if has('nvim') 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 'hrsh7th/cmp-vsnip' +" Plug 'hrsh7th/vim-vsnip' + Plug 'saadparwaiz1/cmp_luasnip' + Plug 'L3MON4D3/LuaSnip' + Plug 'kyazdani42/nvim-web-devicons' + Plug 'kyazdani42/nvim-tree.lua' + "Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} call plug#end() autocmd vimenter * colorscheme gruvbox - let g:deoplete#enable_at_startup = 1 - let g:clang_format#auto_format=1 + autocmd BufEnter *.60 :setlocal filetype=sixtyfps + let g:clang_format#auto_format=0 + + set completeopt=menuone,noselect + +"nvim-tree +let g:nvim_tree_gitignore = 1 "0 by default +let g:nvim_tree_quit_on_open = 0 "0 by default, closes the tree when you open a file +let g:nvim_tree_indent_markers = 1 "0 by default, this option shows indent markers when folders are open +let g:nvim_tree_git_hl = 1 "0 by default, will enable file highlight for git attributes (can be used without the icons). +let g:nvim_tree_highlight_opened_files = 1 "0 by default, will enable folder and file icon highlight for opened files/directories. +let g:nvim_tree_root_folder_modifier = ':~' "This is the default. See :help filename-modifiers for more options +let g:nvim_tree_add_trailing = 1 "0 by default, append a trailing slash to folder names +let g:nvim_tree_group_empty = 0 " 0 by default, compact folders that only contain a single folder into one node in the file tree +let g:nvim_tree_disable_window_picker = 0 "0 by default, will disable the window picker. +let g:nvim_tree_icon_padding = ' ' "one space by default, used for rendering the space between the icon and the filename. Use with caution, it could break rendering if you set an empty string depending on your font. +let g:nvim_tree_symlink_arrow = ' >> ' " defaults to ' ➛ '. used as a separator between symlinks' source and target. +let g:nvim_tree_respect_buf_cwd = 1 "0 by default, will change cwd of nvim-tree to that of new buffer's when opening nvim-tree. +let g:nvim_tree_create_in_closed_folder = 0 "1 by default, When creating files, sets the path of a file when cursor is on a closed folder to the parent folder when 0, and inside the folder when 1. +let g:nvim_tree_refresh_wait = 500 "1000 by default, control how often the tree can be refreshed, 1000 means the tree can be refresh once per 1000ms. +let g:nvim_tree_window_picker_exclude = { + \ 'filetype': [ + \ 'notify', + \ 'packer', + \ 'qf' + \ ], + \ 'buftype': [ + \ 'terminal' + \ ] + \ } +" Dictionary of buffer option names mapped to a list of option values that +" indicates to the window picker that the buffer's window should not be +" selectable. +let g:nvim_tree_special_files = { 'README.md': 1, 'Makefile': 1, 'MAKEFILE': 1 } " List of filenames that gets highlighted with NvimTreeSpecialFile +let g:nvim_tree_show_icons = { + \ 'git': 1, + \ 'folders': 0, + \ 'files': 0, + \ 'folder_arrows': 0, + \ } +"If 0, do not show the icons for one of 'git' 'folder' and 'files' +"1 by default, notice that if 'files' is 1, it will only display +"if nvim-web-devicons is installed and on your runtimepath. +"if folder is 1, you can also tell folder_arrows 1 to show small arrows next to the folder icons. +"but this will not work when you set indent_markers (because of UI conflict) + +" default will show icon by default if no icon is provided +" default shows no icon by default +let g:nvim_tree_icons = { + \ 'default': '', + \ 'symlink': '', + \ 'git': { + \ 'unstaged': "✗", + \ 'staged': "✓", + \ 'unmerged': "", + \ 'renamed': "➜", + \ 'untracked': "★", + \ 'deleted': "", + \ 'ignored': "◌" + \ }, + \ 'folder': { + \ 'arrow_open': "", + \ 'arrow_closed': "", + \ 'default': "", + \ 'open': "", + \ 'empty': "", + \ 'empty_open': "", + \ 'symlink': "", + \ 'symlink_open': "", + \ } + \ } + +nnoremap :NvimTreeToggle +nnoremap r :NvimTreeRefresh +nnoremap n :NvimTreeFindFile +" NvimTreeOpen, NvimTreeClose, NvimTreeFocus, NvimTreeFindFileToggle, and NvimTreeResize are also available if you need them + +set termguicolors " this variable must be enabled for colors to be applied properly + +" a list of groups can be found at `:help nvim_tree_highlight` +highlight NvimTreeFolderIcon guibg=blue + +lua << EOF +local cmp = require'cmp' + +local capabilites = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) +require'lspconfig'.tsserver.setup{ +capabilites = capabilites +} +require'lspconfig'.dockerls.setup{ +capabilites = capabilites +} +require'lspconfig'.eslint.setup{ +capabilites = capabilites +} +require'lspconfig'.gdscript.setup{ +capabilites = capabilites +} +require'lspconfig'.gopls.setup{ +capabilites = capabilites +} + +cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + -- require'snippy'.expand_snippet(args.body) -- For `snippy` users. + end, + }, + mapping = { + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), + [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), + [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), + [''] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. + [''] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }), + [''] = cmp.mapping.confirm({ select = true }), + [''] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, + [''] = function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + -- { name = 'vsnip' }, -- For vsnip users. + { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, { + { name = 'buffer' }, + }) + }) + +cmp.setup.cmdline('/',{ +sources = { + { name = 'buffer' } + } +}) + +cmp.setup.cmdline(':',{ +sources = cmp.config.sources({ +{name = 'path'} +},{{name='cmdline'}}) +}) + +require'nvim-tree'.setup { + disable_netrw = true, + hijack_netrw = true, + open_on_setup = false, + ignore_ft_on_setup = {}, + auto_close = false, + open_on_tab = false, + hijack_cursor = false, + update_cwd = false, + update_to_buf_dir = { + enable = true, + auto_open = true, + }, + diagnostics = { + enable = false, + icons = { + hint = "", + info = "", + warning = "", + error = "", + } + }, + update_focused_file = { + enable = false, + update_cwd = false, + ignore_list = {} + }, + system_open = { + cmd = nil, + args = {} + }, + filters = { + dotfiles = false, + custom = {} + }, + view = { + width = 30, + height = 30, + hide_root_folder = false, + side = 'left', + auto_resize = false, + mappings = { + custom_only = false, + list = {} + } + } +} + +EOF + map f :FZF + nnoremap ca lua vim.lsp.buf.code_action() + nnoremap gd lua vim.lsp.buf.definition() + nnoremap gD lua vim.lsp.buf.declaration() + nnoremap K lua vim.lsp.buf.hover() + nnoremap rn lua vim.lsp.buf.rename() + nnoremap F lua vim.lsp.buf.formatting() + inoremap lua vim.lsp.buf.signature_help() + + autocmd BufWritePre *.ts lua vim.lsp.buf.formatting_sync(nil, 1000) + + endif diff --git a/vim/init.vim b/vim/init.vim new file mode 100644 index 0000000..aa076e6 --- /dev/null +++ b/vim/init.vim @@ -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 +nmap :NERDTreeToggle +vmap ++ NERDCommenterToggle +nmap ++ NERDCommenterToggle +nnoremap :noh + + +" 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 j (v:count == 0 ? 'gj' : 'j') +noremap 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 ' to make sure tab is not mapped by other plugin. +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +" Use to trigger completion. +inoremap coc#refresh() + +" Use to confirm completion, `u` means break undo chain at current position. +" Coc only does snippet and additional edit on confirm. +inoremap pumvisible() ? "\" : "\u\" +" Or use `complete_info` if your vim support it, like: +" inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" + +" Use `[g` and `]g` to navigate diagnostics +nmap [g (coc-diagnostic-prev) +nmap ]g (coc-diagnostic-next) + +" Remap keys for gotos +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +" Use K to show documentation in preview window +nnoremap K :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocAction('doHover') + endif +endfunction + +" Highlight symbol under cursor on CursorHold +autocmd CursorHold * silent call CocActionAsync('highlight') + +" Remap for rename current word +nmap (coc-rename) + +" Remap for format selected region +xmap f (coc-format-selected) +nmap f (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: `aap` for current paragraph +xmap a (coc-codeaction-selected) +nmap a (coc-codeaction-selected) + +" Remap for do codeAction of current line +nmap ac (coc-codeaction) +" Fix autofix problem of current line +nmap qf (coc-fix-current) + +" Create mappings for function text object, requires document symbols feature of languageserver. +xmap if (coc-funcobj-i) +xmap af (coc-funcobj-a) +omap if (coc-funcobj-i) +omap af (coc-funcobj-a) + +" Use for select selections ranges, needs server support, like: coc-tsserver, coc-python +nmap (coc-range-select) +xmap (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', ) + +" 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 a :CocList diagnostics +" Manage extensions +nnoremap e :CocList extensions +" Show commands +nnoremap c :CocList commands +" Find symbol of current document +nnoremap o :CocList outline +" Search workspace symbols +nnoremap s :CocList -I symbols +" Do default action for next item. +nnoremap j :CocNext +" Do default action for previous item. +nnoremap k :CocPrev +" Resume latest coc list +nnoremap p :CocListResume diff --git a/vim/init.vim.new b/vim/init.vim.new new file mode 100644 index 0000000..49a9c33 --- /dev/null +++ b/vim/init.vim.new @@ -0,0 +1,3 @@ +set runtimepath^=/.vim runtimepath+=~/.vim/after +let &packpath = &runtimepath +source ~/.vimrc