commit 355ff09d86701e0d83b62c6e54e961a013916e5e Author: MasterGordon Date: Fri Jul 2 11:10:46 2021 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..060f79b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +plugged/ diff --git a/basic.vim b/basic.vim new file mode 100644 index 0000000..37c0c79 --- /dev/null +++ b/basic.vim @@ -0,0 +1,25 @@ +set number relativenumber +set clipboard=unnamedplus +set mouse=a + +set t_Co=16 +set termguicolors + +filetype plugin indent on +" show existing tab with 4 spaces width +set tabstop=2 +" when indenting with '>', use 4 spaces width +set shiftwidth=2 +" On pressing tab, insert 4 spaces +set expandtab +" Spellcheck +autocmd FileType markdown setlocal spell spelllang=de,en + +set splitright +set splitbelow + +" allow two signs to show up in the sign collumn eg. todo comment and git status +set signcolumn=auto:2 + +" set leader key +let mapleader = "," diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..2b7425f --- /dev/null +++ b/init.vim @@ -0,0 +1,5 @@ +source ~/.config/nvim/basic.vim +source ~/.config/nvim/plugins.vim + +autocmd bufnewfile,bufread *.tsx set filetype=typescriptreact +autocmd bufnewfile,bufread *.jsx set filetype=javascriptreact diff --git a/plugins.vim b/plugins.vim new file mode 100644 index 0000000..80adc15 --- /dev/null +++ b/plugins.vim @@ -0,0 +1,321 @@ +call plug#begin() +Plug 'glepnir/galaxyline.nvim' , {'branch': 'main'} +Plug 'kyazdani42/nvim-web-devicons' " for file icons +Plug 'kyazdani42/nvim-tree.lua' +Plug 'junegunn/goyo.vim' +Plug 'JoosepAlviste/nvim-ts-context-commentstring' +Plug 'tpope/vim-commentary' +Plug 'mhinz/vim-signify' +Plug 'neovim/nvim-lspconfig' +Plug 'mhartington/formatter.nvim' +Plug 'hrsh7th/nvim-compe' +Plug 'onsails/lspkind-nvim' +Plug 'MasterGordon/monokai.nvim' +Plug 'ron89/thesaurus_query.vim' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'blackcauldron7/surround.nvim' +Plug 'nvim-lua/popup.nvim' +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-telescope/telescope.nvim' +Plug 'SidOfc/mkdx' +Plug 'nacro90/numb.nvim' +Plug 'glepnir/dashboard-nvim' +Plug 'norcalli/nvim-colorizer.lua' +Plug 'davidgranstrom/nvim-markdown-preview' +Plug 'RishabhRD/popfix' +Plug 'RishabhRD/nvim-lsputils' +Plug 'akinsho/nvim-bufferline.lua' +Plug 'folke/todo-comments.nvim' +Plug 'windwp/nvim-ts-autotag' +Plug 'jiangmiao/auto-pairs' +Plug 'simrat39/symbols-outline.nvim' +Plug 'ray-x/lsp_signature.nvim' + +" post install (yarn install | npm install) then load plugin only for editing supported files +call plug#end() + +nmap f Telescope find_files + +lua require('numb').setup() + +" Theme +colorscheme monokai + +" StatusLine +luafile $HOME/.config/nvim/plugins/galaxyline.lua + +" Lsp Signature +" lua require'lsp_signature'.on_attach() + +" Dashboard +let g:dashboard_default_executive ='telescope' +nnoremap r :DashboardFindHistory + +" Startify +let g:startify_custom_header = startify#pad(split(system('cat $HOME/.config/nvim/splash'), '\n')) +lua << EOF +function _G.webDevIcons(path) + local filename = vim.fn.fnamemodify(path, ':t') + local extension = vim.fn.fnamemodify(path, ':e') + return require'nvim-web-devicons'.get_icon(filename, extension, { default = true }) +end +EOF + +function! StartifyEntryFormat() abort + return 'v:lua.webDevIcons(absolute_path) . " " . entry_path' +endfunction + +" commentstring +lua << EOF +require'nvim-treesitter.configs'.setup { + context_commentstring = { + enable = true + } +} +EOF + +" Outline +noremap o :SymbolsOutline + +" Bufferline +lua < :lua require"bufferline".go_to_buffer(1) +noremap :lua require"bufferline".go_to_buffer(2) +noremap :lua require"bufferline".go_to_buffer(3) +noremap :lua require"bufferline".go_to_buffer(4) +noremap :lua require"bufferline".go_to_buffer(5) +noremap :lua require"bufferline".go_to_buffer(6) +noremap :lua require"bufferline".go_to_buffer(7) +noremap :lua require"bufferline".go_to_buffer(8) +noremap :lua require"bufferline".go_to_buffer(9) +noremap :lua require"bufferline".go_to_buffer(10) +noremap +noremap +noremap +noremap + +" colorizer +lua <p :Prettier + +" Surround +lua require"surround".setup{} + +" NVim Tree Config +let g:nvim_tree_auto_close = 1 +let g:nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] +let g:nvim_tree_indent_markers = 1 +map :NvimTreeFindFile + +let g:nvim_tree_icons = { + \ 'default': '', + \ 'symlink': '', + \ 'git': { + \ 'unstaged': "✗", + \ 'staged': "✓", + \ 'unmerged': "", + \ 'renamed': "➜", + \ 'untracked': "★" + \ }, + \ 'folder': { + \ 'default': "", + \ 'open': "", + \ 'symlink': "", + \ } + \ } + +lua <"] = tree_cb("edit"), + ["<2-LeftMouse>"] = tree_cb("edit"), + ["<2-RightMouse>"] = tree_cb("cd"), + [""] = tree_cb("cd"), + ["s"] = tree_cb("vsplit"), + ["i"] = tree_cb("split"), + ["t"] = tree_cb("tabnew"), + ["<"] = tree_cb("prev_sibling"), + [">"] = tree_cb("next_sibling"), + [""] = tree_cb("close_node"), + [""] = tree_cb("close_node"), + [""] = tree_cb("preview"), + ["I"] = tree_cb("toggle_ignored"), + ["I"] = tree_cb("toggle_dotfiles"), + ["r"] = tree_cb("refresh"), + ["c"] = tree_cb("create"), + ["d"] = tree_cb("remove"), + ["m"] = tree_cb("rename"), + [""] = tree_cb("full_rename"), + ["x"] = tree_cb("cut"), + ["c"] = tree_cb("copy"), + ["p"] = tree_cb("paste"), + ["[c"] = tree_cb("prev_git_item"), + ["]c"] = tree_cb("next_git_item"), + ["-"] = tree_cb("dir_up"), + ["q"] = tree_cb("close"), + } +EOF + +" TreeSitter +lua <s :ThesaurusQueryReplaceCurrentWord +let g:tq_language=['en', 'de'] +let g:tq_enabled_backends=["openthesaurus_de", "woxikon_de", "openoffice_en", "datamuse_com"] + +" Tagalong +let g:tagalong_verbose = 1 +let g:tagalong_filetypes = ['html', 'xml', 'jsx', 'tsx', 'eruby', 'ejs', 'eco', 'php', 'htmldjango', 'javascriptreact', 'typescriptreact', 'typescript.tsx', 'javascript.jsx', 'mako'] +let g:tagalong_additional_filetypes = ['typescript.tsx', 'javascript.jsx', 'mako'] + +" coc.nvim +" source plugins/coc.vim + +" nvim-lsp +luafile $HOME/.config/nvim/plugins/lsp.lua + +" Formatter +luafile $HOME/.config/nvim/plugins/formatter.lua + +" nvim.compe +luafile $HOME/.config/nvim/plugins/compe.lua +inoremap compe#complete() +inoremap compe#confirm('') +inoremap compe#close('') +inoremap compe#scroll({ 'delta': +4 }) +inoremap compe#scroll({ 'delta': -4 }) + +" lspkind +lua <lua vim.lsp.buf.declaration()", opts) + buf_set_keymap("n", "gd", "lua vim.lsp.buf.definition()", opts) + buf_set_keymap("n", "K", "lua vim.lsp.buf.hover()", opts) + buf_set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts) + buf_set_keymap("n", "", "lua vim.lsp.buf.signature_help()", opts) + buf_set_keymap("n", "wa", "lua vim.lsp.buf.add_workspace_folder()", opts) + buf_set_keymap("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()", opts) + buf_set_keymap("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", opts) + buf_set_keymap("n", "t", "lua vim.lsp.buf.type_definition()", opts) + buf_set_keymap("n", "", "lua vim.lsp.buf.rename()", opts) + buf_set_keymap("n", "a", "lua vim.lsp.buf.code_action()", opts) + buf_set_keymap("n", "gr", "lua vim.lsp.buf.references()", opts) + buf_set_keymap("n", "d", "lua vim.lsp.diagnostic.show_line_diagnostics()", opts) + buf_set_keymap("n", "[d", "lua vim.lsp.diagnostic.goto_prev()", opts) + buf_set_keymap("n", "]d", "lua vim.lsp.diagnostic.goto_next()", opts) + buf_set_keymap("n", "q", "lua vim.lsp.diagnostic.set_loclist()", opts) +end + +local servers = {"pyright", "rust_analyzer", "tsserver"} +for _, lsp in ipairs(servers) do + nvim_lsp[lsp].setup {on_attach = on_attach} +end diff --git a/plugins/lspsaga.lua b/plugins/lspsaga.lua new file mode 100644 index 0000000..946ad9d --- /dev/null +++ b/plugins/lspsaga.lua @@ -0,0 +1,36 @@ +local saga = require 'lspsaga' + +saga.init_lsp_saga { + use_saga_diagnostic_sign = true, + error_sign = '', + warn_sign = '', + hint_sign = '', + infor_sign = '', + dianostic_header_icon = '  ', + code_action_icon = ' ', + code_action_prompt = { + enable = true, + sign = true, + sign_priority = 20, + virtual_text = true, + }, + finder_definition_icon = ' ', + finder_reference_icon = ' ', + max_preview_lines = 10, -- preview lines of lsp_finder and definition preview + finder_action_keys = { + open = 'o', vsplit = 's',split = 'i',quit = 'q',scroll_down = '', scroll_up = '' -- quit can be a table + }, + code_action_keys = { + quit = 'q',exec = '' + }, + rename_action_keys = { + quit = '',exec = '' -- quit can be a table + }, + definition_preview_icon = ' ', + -- "single" "double" "round" "plus" + border_style = "single", + rename_prompt_prefix = '➤', + -- if you don't use nvim-lspconfig you must pass your server name and + -- the related filetypes into this table + server_filetype_map = {}, +} diff --git a/spell/de.utf-8.add b/spell/de.utf-8.add new file mode 100644 index 0000000..2e5ddb7 --- /dev/null +++ b/spell/de.utf-8.add @@ -0,0 +1,15 @@ +data +content +app +JS +CSS +JSON +Frameworks +cherrypy +mappings +Application +templates +Gordon +author +index +request diff --git a/spell/de.utf-8.add.spl b/spell/de.utf-8.add.spl new file mode 100644 index 0000000..6a872f6 Binary files /dev/null and b/spell/de.utf-8.add.spl differ diff --git a/spell/de.utf-8.spl b/spell/de.utf-8.spl new file mode 100644 index 0000000..37cbbca Binary files /dev/null and b/spell/de.utf-8.spl differ diff --git a/splash b/splash new file mode 100644 index 0000000..51881e8 --- /dev/null +++ b/splash @@ -0,0 +1,6 @@ +'|. '|' '||''''| ..|''|| '||' '|' '||' '|| ||' + |'| | || . .|' || '|. .' || ||| ||| + | '|. | ||''| || || || | || |'|..'|| + | ||| || '|. || ||| || | '|' || +.|. '| .||.....| ''|...|' | .||. .|. | .||. +