├── .gitignore ├── README.md ├── config ├── init.vim └── lua │ ├── cmp_settings.lua │ ├── keymaps.lua │ ├── omnisharp_settings.lua │ ├── plugin_settings.lua │ ├── plugins.lua │ └── settings.lua ├── linux_install.py └── screenshots ├── preview1.png └── preview2.png /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | logfile.log 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Doovim 2 | 3 | Doovim is my configuration for neovim. It presents a bunch of plugins, settings and keymaps. 4 | 5 | ![no image](https://raw.githubusercontent.com/doopath/doovim/master/screenshots/preview2.png) 6 | ![no image](https://raw.githubusercontent.com/doopath/doovim/master/screenshots/preview1.png) 7 | 8 | # Requirements 9 | A bunch of requirements you need to have: 10 | - Python 3 11 | - Nodejs 14 or higher 12 | - vim-plug (is installed by _linux_install.py_ script) 13 | - Yarn from npm 14 | - Pynvim from pip 15 | 16 | # Installation 17 | If you have a linux distro then just download the repo and launch _linux_install.py_ overwhise, copy eveything from _config_ to your nvim config dir. 18 | -------------------------------------------------------------------------------- /config/init.vim: -------------------------------------------------------------------------------- 1 | lua require("plugins") 2 | " lua require("cmp_settings") 3 | "" I prefer coc.nvim over the CMP but you can uncomment it 4 | "" and complete the lua/cmp_settings.lua configuration to use CMP. 5 | lua require("plugin_settings") 6 | lua require("omnisharp_settings") 7 | lua require("settings") 8 | lua require("keymaps") 9 | 10 | "" coc.nvim settings 11 | inoremap 12 | \ coc#pum#visible() ? coc#pum#next(1) : 13 | \ CheckBackspace() ? "\" : 14 | \ coc#refresh() 15 | inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" 16 | 17 | inoremap coc#pum#visible() ? coc#pum#confirm() : "\" 18 | 19 | function! CheckBackspace() abort 20 | let col = col('.') - 1 21 | return !col || getline('.')[col - 1] =~# '\s' 22 | endfunction 23 | 24 | if has('nvim') 25 | inoremap coc#refresh() 26 | else 27 | inoremap coc#refresh() 28 | endif 29 | 30 | 31 | nmap [g (coc-diagnostic-prev) 32 | nmap ]g (coc-diagnostic-next) 33 | 34 | nmap gd (coc-definition) 35 | nmap gy (coc-type-definition) 36 | nmap gi (coc-implementation) 37 | nmap gr (coc-references) 38 | 39 | nnoremap K :call show_documentation() 40 | 41 | function! s:show_documentation() 42 | if (index(['vim','help'], &filetype) >= 0) 43 | execute 'h '.expand('') 44 | elseif (coc#rpc#ready()) 45 | call CocActionAsync('doHover') 46 | else 47 | execute '!' . &keywordprg . " " . expand('') 48 | endif 49 | endfunction 50 | 51 | autocmd CursorHold * silent call CocActionAsync('highlight') 52 | 53 | nmap rn (coc-rename) 54 | 55 | xmap f (coc-format-selected) 56 | nmap f (coc-format-selected) 57 | 58 | augroup mygroup 59 | autocmd! 60 | autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') 61 | autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') 62 | augroup end 63 | 64 | xmap a (coc-codeaction-selected) 65 | nmap a (coc-codeaction-selected) 66 | 67 | nmap ac (coc-codeaction) 68 | nmap qf (coc-fix-current) 69 | 70 | xmap if (coc-funcobj-i) 71 | omap if (coc-funcobj-i) 72 | xmap af (coc-funcobj-a) 73 | omap af (coc-funcobj-a) 74 | xmap ic (coc-classobj-i) 75 | omap ic (coc-classobj-i) 76 | xmap ac (coc-classobj-a) 77 | omap ac (coc-classobj-a) 78 | 79 | if has('nvim-0.4.0') || has('patch-8.2.0750') 80 | nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" 81 | nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" 82 | inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" 83 | inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" 84 | vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" 85 | vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" 86 | endif 87 | 88 | nmap (coc-range-select) 89 | xmap (coc-range-select) 90 | 91 | command! -nargs=0 Format :call CocAction('format') 92 | command! -nargs=? Fold :call CocAction('fold', ) 93 | command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') 94 | 95 | set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} 96 | 97 | nnoremap a :CocList diagnostics 98 | nnoremap e :CocList extensions 99 | nnoremap c :CocList commands 100 | nnoremap o :CocList outline 101 | nnoremap s :CocList -I symbols 102 | nnoremap j :CocNext 103 | nnoremap k :CocPrev 104 | nnoremap p :CocListResume 105 | -------------------------------------------------------------------------------- /config/lua/cmp_settings.lua: -------------------------------------------------------------------------------- 1 | -- Add additional capabilities supported by nvim-cmp 2 | -- nvim-cmp setup 3 | local cmp = require 'cmp' 4 | local nvim_lsp = require('lspconfig') 5 | 6 | cmp.setup { 7 | snippet = { 8 | expand = function(args) 9 | require('luasnip').lsp_expand(args.body) 10 | end, 11 | }, 12 | mapping = { 13 | [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), 14 | [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), 15 | [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), 16 | [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), 17 | [''] = cmp.mapping.scroll_docs(-4), 18 | [''] = cmp.mapping.scroll_docs(4), 19 | [''] = cmp.mapping.complete(), 20 | [''] = cmp.mapping.close(), 21 | [''] = cmp.mapping.confirm({ 22 | behavior = cmp.ConfirmBehavior.Replace, 23 | select = true, 24 | }) 25 | }, 26 | [''] = function(fallback) 27 | if cmp.visible() then 28 | cmp.select_next_item() 29 | elseif luasnip.expand_or_jumpable() then 30 | luasnip.expand_or_jump() 31 | else 32 | fallback() 33 | end 34 | end, 35 | [''] = function(fallback) 36 | if cmp.visible() then 37 | cmp.select_prev_item() 38 | elseif luasnip.jumpable(-1) then 39 | luasnip.jump(-1) 40 | else 41 | fallback() 42 | end 43 | end, 44 | sources = { 45 | { name = 'nvim_lsp' }, 46 | { name = 'luasnip' }, 47 | } 48 | } 49 | 50 | -- Use an on_attach function to only map the following keys 51 | -- after the language server attaches to the current buffer 52 | local on_attach = function(client, bufnr) 53 | local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end 54 | local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end 55 | 56 | -- Enable completion triggered by 57 | buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') 58 | 59 | -- Mappings. 60 | local opts = { noremap=true, silent=true } 61 | 62 | -- See `:help vim.lsp.*` for documentation on any of the below functions 63 | buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) 64 | buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) 65 | buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) 66 | buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) 67 | buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) 68 | buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) 69 | buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) 70 | buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) 71 | buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) 72 | buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) 73 | buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) 74 | buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) 75 | buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) 76 | buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) 77 | buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) 78 | buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) 79 | buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) 80 | end 81 | 82 | 83 | -- Use a loop to conveniently call 'setup' on multiple servers and 84 | -- map buffer local keybindings when the language server attaches 85 | local servers = { 'pyright', 'tsserver' } 86 | local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) 87 | for _, lsp in ipairs(servers) do 88 | nvim_lsp[lsp].setup { 89 | on_attach = on_attach, 90 | capabilities = capabilities, 91 | flags = { 92 | debounce_text_changes = 150, 93 | } 94 | } 95 | end 96 | 97 | -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). 98 | cmp.setup.cmdline('/', { 99 | sources = { 100 | { name = 'buffer' } 101 | } 102 | }) 103 | 104 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 105 | cmp.setup.cmdline(':', { 106 | sources = cmp.config.sources({ 107 | { name = 'path' } 108 | }, { 109 | { name = 'cmdline' } 110 | }) 111 | }) 112 | 113 | local capabilities = vim.lsp.protocol.make_client_capabilities() 114 | capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) 115 | 116 | -- Set completeopt to have a better completion experience 117 | vim.o.completeopt = 'menuone,noselect' 118 | 119 | -------------------------------------------------------------------------------- /config/lua/keymaps.lua: -------------------------------------------------------------------------------- 1 | local map = vim.api.nvim_set_keymap 2 | local default_opts = { noremap = true, silent = true } 3 | local builtin = require('telescope.builtin') 4 | 5 | 6 | -- Show project tree 7 | map('n', '', ':NvimTreeRefresh:NvimTreeToggle', default_opts) 8 | 9 | 10 | -- Buffers maps 11 | -- You can switch between buffers by + buffer number 12 | map('n', '1', ':1b', default_opts) 13 | map('n', '2', ':2b', default_opts) 14 | map('n', '3', ':3b', default_opts) 15 | map('n', '4', ':4b', default_opts) 16 | map('n', '5', ':5b', default_opts) 17 | map('n', '6', ':6b', default_opts) 18 | map('n', '7', ':7b', default_opts) 19 | map('n', '8', ':8b', default_opts) 20 | map('n', '9', ':9b', default_opts) 21 | map('n', '0', ':10b', default_opts) 22 | 23 | map('n', 'n', ':noh', default_opts) 24 | 25 | 26 | ---- I use telescope btw 27 | ---- FZF settings 28 | -- map('n', 'b', ":Buffers", default_opts) 29 | -- map('n', 'l', ":BLines", default_opts) 30 | -- map('n', 'L', ":Lines", default_opts) 31 | -- map('n', 't', ":Tabs", default_opts) 32 | -- map('n', 'F', ":Files", default_opts) 33 | 34 | map('n', 'ff', ':Telescope find_files find_command=rg,--ignore,--hidden,--files', default_opts) 35 | vim.keymap.set('n', 'fg', builtin.live_grep, default_opts) 36 | vim.keymap.set('n', 'fb', builtin.buffers, default_opts) 37 | vim.keymap.set('n', 'fh', builtin.help_tags, default_opts) 38 | 39 | -- Enable in the terminal mode (:term) 40 | map('t', '', '', {noremap = true, silent = false}) 41 | 42 | 43 | -- Mappings to move between plited windows by WinMove function 44 | map('n', '', ':call MoveWindow(\'h\')', default_opts) 45 | map('n', '', ':call MoveWindow(\'j\')', default_opts) 46 | map('n', '', ':call MoveWindow(\'k\')', default_opts) 47 | map('n', '', ':call MoveWindow(\'l\')', default_opts) 48 | 49 | -- Resize split windows 50 | map('n', '', ':vertical resize +5', default_opts) 51 | map('n', '', ':vertical resize -5', default_opts) 52 | map('n', '', ':resize +5', default_opts) 53 | map('n', '', ':resize -5', default_opts) 54 | 55 | -- Move between windows or create new ones 56 | -- Close your eyes when you read this code, cuz i'm not familiar with lua... 57 | vim.g.MoveWindow = function(key) 58 | local command = string.format("exec \"wincmd %s\"", key) 59 | 60 | vim.t.curwin = vim.fn.winnr() 61 | vim.api.nvim_exec(command, true) 62 | 63 | if vim.t.curwin == vim.fn.winnr() then 64 | local res = vim.fn.match(key, '[jk]') 65 | 66 | if res == 0 then 67 | vim.api.nvim_exec("wincmd s", true) 68 | else 69 | vim.api.nvim_exec("wincmd v", true) 70 | end 71 | 72 | vim.api.nvim_exec(command, true) 73 | end 74 | end 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /config/lua/omnisharp_settings.lua: -------------------------------------------------------------------------------- 1 | local cmd = vim.cmd 2 | 3 | cmd [[ 4 | if has('patch-8.1.1880') 5 | set completeopt=longest,menuone,popuphidden 6 | set completepopup=highlight:Pmenu,border:off 7 | else 8 | set completeopt=longest,menuone,preview 9 | set previewheight=5 10 | endif 11 | 12 | let g:ale_linters = { 'cs': ['OmniSharp'] } 13 | 14 | augroup omnisharp_commands 15 | autocmd! 16 | 17 | autocmd CursorHold *.cs OmniSharpTypeLookup 18 | 19 | autocmd FileType cs nmap gd (omnisharp_go_to_definition) 20 | autocmd FileType cs nmap osfu (omnisharp_find_usages) 21 | autocmd FileType cs nmap osfi (omnisharp_find_implementations) 22 | autocmd FileType cs nmap ospd (omnisharp_preview_definition) 23 | autocmd FileType cs nmap ospi (omnisharp_preview_implementations) 24 | autocmd FileType cs nmap ost (omnisharp_type_lookup) 25 | autocmd FileType cs nmap osd (omnisharp_documentation) 26 | autocmd FileType cs nmap osfs (omnisharp_find_symbol) 27 | autocmd FileType cs nmap osfx (omnisharp_fix_usings) 28 | autocmd FileType cs nmap (omnisharp_signature_help) 29 | autocmd FileType cs imap (omnisharp_signature_help) 30 | 31 | autocmd FileType cs nmap \[\[ (omnisharp_navigate_up) 32 | autocmd FileType cs nmap \]\] (omnisharp_navigate_down) 33 | autocmd FileType cs nmap osgcc (omnisharp_global_code_check) 34 | autocmd FileType cs nmap osca (omnisharp_code_actions) 35 | autocmd FileType cs xmap osca (omnisharp_code_actions) 36 | autocmd FileType cs nmap os. (omnisharp_code_action_repeat) 37 | autocmd FileType cs xmap os. (omnisharp_code_action_repeat) 38 | 39 | autocmd FileType cs nmap os= (omnisharp_code_format) 40 | 41 | autocmd FileType cs nmap osnm (omnisharp_rename) 42 | 43 | autocmd FileType cs nmap osre (omnisharp_restart_server) 44 | autocmd FileType cs nmap osst (omnisharp_start_server) 45 | autocmd FileType cs nmap ossp (omnisharp_stop_server) 46 | augroup END]] 47 | -------------------------------------------------------------------------------- /config/lua/plugin_settings.lua: -------------------------------------------------------------------------------- 1 | local g = vim.g 2 | 3 | require('lualine').setup { 4 | options = { 5 | theme = 'gruvbox' 6 | }, 7 | tabline = { 8 | lualine_a = {'buffers'}, 9 | lualine_x = {}, 10 | lualine_y = {}, 11 | lualine_z = {'tabs'} 12 | } 13 | } 14 | 15 | 16 | require('telescope').setup { 17 | defaults = { 18 | vimgrep_arguments = { 19 | 'rg', 20 | '--hidden', 21 | '--color=never', 22 | '--no-heading', 23 | '--with-filename', 24 | '--line-number', 25 | '--column', 26 | '--smart-case' 27 | } 28 | } 29 | } 30 | 31 | require('nvim-tree').setup { 32 | disable_netrw = true, 33 | hijack_netrw = true, 34 | open_on_setup = false, 35 | ignore_ft_on_setup = {}, 36 | open_on_tab = true, 37 | hijack_cursor = false, 38 | update_cwd = false, 39 | diagnostics = { 40 | enable = false, 41 | icons = { 42 | hint = "", 43 | info = "", 44 | warning = "", 45 | error = "", 46 | } 47 | }, 48 | update_focused_file = { 49 | enable = false, 50 | update_cwd = false, 51 | ignore_list = {} 52 | }, 53 | system_open = { 54 | cmd = nil, 55 | args = {} 56 | }, 57 | filters = { 58 | dotfiles = false, 59 | custom = {} 60 | }, 61 | view = { 62 | width = 40, 63 | hide_root_folder = false, 64 | side = 'left', 65 | mappings = { 66 | custom_only = false, 67 | list = {} 68 | } 69 | } 70 | } 71 | 72 | -- Ultisnips mapping 73 | g.UltiSnipsExpandTrigger='' 74 | g.UltiSnipsJumpForwardTrigger='' 75 | g.UltiSnipsJumpBackwardTrigger='' 76 | 77 | 78 | -- Blamer settings 79 | g.blamer_enabled = 1 80 | 81 | 82 | -- NerdCommenter settings 83 | g.NERDSpaceDelims = 1 -- Add spaces after comment delimiters by default 84 | g.NERDCompactSexyComs = 1 -- Use compact syntax for prettified multi-line comments 85 | -- Align line-wise comment delimiters flush left instead of following code indentation 86 | g.NERDDefaultAlign = 'left' 87 | g.NERDAltDelims_java = 1 -- Set a language to use its alternate delimiters by default 88 | -- Allow commenting and inverting empty lines (useful when commenting a region) 89 | g.NERDCommentEmptyLines = 1 90 | g.NERDTrimTrailingWhitespace = 1 -- Enable trimming of trailing whitespace when uncommenting 91 | -- Enable NERDCommenterToggle to check all selected lines is commented or not 92 | g.NERDToggleCheckAllLines = 1 93 | 94 | -------------------------------------------------------------------------------- /config/lua/plugins.lua: -------------------------------------------------------------------------------- 1 | local Plug = vim.fn['plug#'] 2 | 3 | vim.call('plug#begin', '~/.vim/plugged') 4 | 5 | 6 | -- Awesome files viewer for vim ==> 7 | Plug 'kyazdani42/nvim-web-devicons' 8 | Plug 'kyazdani42/nvim-tree.lua' 9 | 10 | -- Awesome asynchronous linter 11 | Plug 'dense-analysis/ale' 12 | 13 | -- Telescope 14 | Plug 'nvim-lua/plenary.nvim' 15 | Plug 'nvim-telescope/telescope.nvim' 16 | 17 | -- Languages support 18 | Plug 'sheerun/vim-polyglot' 19 | 20 | -- Status bar plugins ==> 21 | Plug 'nvim-lualine/lualine.nvim' 22 | 23 | -- Very useful things ==> 24 | Plug 'jiangmiao/auto-pairs' 25 | Plug 'tpope/vim-surround' -- include word/line in '[{< and other stuff like those 26 | Plug 'preservim/nerdcommenter' -- -c-l to comment; -c-u to uncomment 27 | Plug 'junegunn/fzf.vim' 28 | Plug 'APZelos/blamer.nvim' -- A plugin like the 'git-lense' for vscode 29 | Plug 'ap/vim-css-color' 30 | Plug 'airblade/vim-gitgutter' 31 | Plug 'iamcco/markdown-preview.nvim' 32 | 33 | -- CSharp and FSharp support 34 | -- Plug 'OmniSharp/omnisharp-vim' 35 | -- Plug ('ionide/Ionide-vim', { ['do'] = 'make fsautocomplete' }) 36 | 37 | -- Haskell and Cabal support 38 | -- Plug 'neovimhaskell/haskell-vim' 39 | 40 | -- Appearance plugins ==> 41 | -- Color schemes 42 | Plug 'arcticicestudio/nord-vim' 43 | Plug 'doopath/doobox' 44 | Plug ('dracula/vim', { as = 'dracula' }) 45 | Plug 'ulwlu/elly.vim' 46 | Plug 'joshdick/onedark.vim' 47 | Plug 'morhetz/gruvbox' 48 | 49 | -- These themes are created by this awesome guy https://github.com/sainnhe ==> 50 | Plug 'sainnhe/forest-night' 51 | Plug 'sainnhe/edge' 52 | Plug 'sainnhe/sonokai' 53 | 54 | -- Transparent vim 55 | Plug 'kjwon15/vim-transparent' 56 | 57 | -- Icons for bars (and nerdtree) 58 | Plug 'ryanoasis/vim-devicons' 59 | 60 | -- IDE Feautures ==> 61 | Plug('github/copilot.vim') 62 | Plug('neoclide/coc.nvim', {branch = 'release'}) 63 | Plug 'SirVer/ultisnips' -- Powerful snippets 64 | Plug 'honza/vim-snippets' -- Also, improves your expirience 65 | -- Live server inside the code-editor like VSCode live-server 66 | Plug 'turbio/bracey.vim' 67 | 68 | -- LSP for neovim. I prefer to use coc.nvim 69 | -- Plug 'neovim/nvim-lspconfig' -- Collection of configurations for built-in LSP client 70 | -- Plug 'hrsh7th/nvim-cmp' -- Autocompletion plugin 71 | -- Plug 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp 72 | -- Plug 'hrsh7th/cmp-buffer' 73 | -- Plug 'hrsh7th/cmp-path' 74 | -- Plug 'hrsh7th/cmp-cmdline' 75 | -- Plug 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp 76 | -- Plug 'L3MON4D3/LuaSnip' -- Snippets plugin 77 | 78 | 79 | 80 | vim.call('plug#end') 81 | -------------------------------------------------------------------------------- /config/lua/settings.lua: -------------------------------------------------------------------------------- 1 | local cmd = vim.cmd 2 | local opt = vim.opt 3 | local g = vim.g 4 | local s = vim.s 5 | 6 | local tab_width = 4 7 | 8 | 9 | -- colorscheme option: 10 | -- Available themes: nord, dracula, onedark, doobox 11 | -- Sainnhe themes : edge, forest-night, sonokai 12 | -- 13 | -- buigb, ctermbg options: 14 | -- Make transparent background 15 | -- Also, if you want to make you terminal background 16 | -- transparent you need to set it in you terminal configuration 17 | -- If you use konsole: 18 | -- Right click -> Edit Current Profile -> Appearance -> Edit -> 19 | -- -> Background Transparency 20 | cmd [[ 21 | syntax on 22 | highlight Normal ctermbg=None 23 | filetype plugin on 24 | colorscheme doobox 25 | hi statusline guibg=#FFFFFFFF guifg=#D8DEE9 26 | hi Normal guibg=NONE ctermbg=NONE 27 | 28 | set t_Co=256 29 | set nobackup 30 | set noswapfile 31 | ]] 32 | 33 | opt.termguicolors = true 34 | opt.guifont = 'JetBrainsMono Nerd Font:h7' 35 | opt.laststatus = 2 36 | opt.autoindent = true 37 | opt.clipboard = opt.clipboard + 'unnamedplus' 38 | 39 | opt.softtabstop = tab_width 40 | opt.linespace = tab_width 41 | opt.tabstop = tab_width 42 | opt.shiftwidth = tab_width 43 | 44 | opt.number = true 45 | opt.relativenumber = true 46 | opt.expandtab = true 47 | opt.hlsearch = true 48 | opt.incsearch = true 49 | opt.ruler = true 50 | opt.encoding = 'utf-8' 51 | opt.fileencodings = 'utf-8,cp1251' 52 | 53 | 54 | -- Edge color scheme settings 55 | g.edge_style = 'neon' 56 | g.edge_enable_italic = 1 57 | 58 | -- Maps 59 | g.mapleader=',' -- Too useful (if you dont want to get carpal tunnel) 60 | g.jsx_ext_required = 1 61 | g.jsx_pragma_required = 1 62 | g.user_emmet_leader_key = '' 63 | 64 | -------------------------------------------------------------------------------- /linux_install.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import traceback 4 | import shutil 5 | 6 | 7 | def require_linux(os: str) -> None: 8 | assert os == 'linux', 'Your current os is not a Linux distro! ' +\ 9 | 'This script only available on Linux!' 10 | 11 | 12 | def get_app_dir() -> str: 13 | return os.path.dirname(os.path.abspath(sys.argv[0])) 14 | 15 | 16 | def get_log_file() -> str: 17 | return os.path.join(get_app_dir(), 'logfile.log') 18 | 19 | 20 | class Logger: 21 | def __init__(self): 22 | self._app_dir = get_app_dir() 23 | self._log_file = get_log_file() 24 | 25 | @staticmethod 26 | def beautify_exception(exc: Exception) -> str: 27 | return f'Error: {type(exc).__name__}: {exc}' 28 | 29 | def log_traceback(self) -> None: 30 | tb = traceback.format_exc() 31 | 32 | with open(self._log_file, 'a') as file: 33 | file.write(tb) 34 | 35 | 36 | class Installer: 37 | def __init__(self): 38 | self._app_dir = get_app_dir() 39 | self._logfile = get_log_file() 40 | self._nvim_config_dir = self._get_nvim_config_dir() 41 | self._doovim_config_dir = self._get_doovim_config_dir() 42 | 43 | def _get_nvim_config_dir(self) -> str: 44 | return os.path.expanduser('~/.config/nvim') 45 | 46 | def _get_doovim_config_dir(self) -> str: 47 | return os.path.join(self._app_dir, 'config') 48 | 49 | def _is_nvim_config_exists(self) -> bool: 50 | return os.path.exists(self._nvim_config_dir) 51 | 52 | def _create_nvim_config_dir(self) -> None: 53 | os.mkdir(self._nvim_config_dir) 54 | 55 | def _archive_nvim_config(self) -> None: 56 | shutil.move(self._nvim_config_dir, self._nvim_config_dir + '.bak') 57 | 58 | def _setup_nvim_config(self) -> None: 59 | if self._is_nvim_config_exists(): 60 | print('You already have nvim configuration, so the current config ' \ 61 | 'will be saved as nvim.bak in your .config directory.\n') 62 | self._archive_nvim_config() 63 | 64 | self._create_nvim_config_dir() 65 | 66 | def _install_vim_plug(self) -> None: 67 | print('\nInstalling vim-plug...\n') 68 | os.system('sh -c \'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}' \ 69 | '"/nvim/site/autoload/plug.vim --create-dirs ' \ 70 | 'https://raw.githubusercontent.com/junegunn' \ 71 | '/vim-plug/master/plug.vim\''\ 72 | f' >> {self._logfile}') 73 | print('\nvim-plug was successfully installed!\n') 74 | 75 | def _show_installation_end(self) -> None: 76 | print('Congrats! Doovim config was successfully installed! ' \ 77 | 'Now you need to install npm, nodejs from your distro\'s repos ' \ 78 | 'and also install pynvim and yarn from pip and npm.\n' \ 79 | 'After you open nvim it will show you a bunch or errors, ' \ 80 | 'you just need to run :PlugInstall and :UpdateRemotePlugins ' \ 81 | 'and then restart nvim.\n' \ 82 | 'Also, I highly recommend to you to install some of NerdFonts for better expirience.\n' \ 83 | 'With love by doopath\n' \ 84 | 'Any questions: doopath@gmail.com\n') 85 | 86 | def install(self): 87 | self._setup_nvim_config() 88 | self._install_vim_plug() 89 | 90 | operation_counter = 1 91 | 92 | for file in os.listdir(self._doovim_config_dir): 93 | src = os.path.join(self._doovim_config_dir, file) 94 | dst = os.path.join(self._nvim_config_dir, file) 95 | 96 | print(f'{operation_counter}. Copying {src} to {dst}!') 97 | 98 | if os.path.isfile(src): 99 | shutil.copy(src, dst) 100 | else: 101 | shutil.copytree(src, dst) 102 | 103 | print(f'{operation_counter}. {src} successfully copied to {dst}!\n') 104 | operation_counter += 1 105 | 106 | self._show_installation_end() 107 | 108 | 109 | def main() -> None: 110 | try: 111 | require_linux(sys.platform) 112 | Installer().install() 113 | except Exception as exc: 114 | print(Logger.beautify_exception(exc)) 115 | Logger().log_traceback() 116 | sys.exit(1) 117 | 118 | 119 | if __name__ == '__main__': 120 | main() 121 | 122 | -------------------------------------------------------------------------------- /screenshots/preview1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doopath/doovim/8459d4fea8dc055207171ebed3fa9acc30035f3e/screenshots/preview1.png -------------------------------------------------------------------------------- /screenshots/preview2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doopath/doovim/8459d4fea8dc055207171ebed3fa9acc30035f3e/screenshots/preview2.png --------------------------------------------------------------------------------