diff --git a/README.md b/README.md index 7f8d108..6acc601 100644 --- a/README.md +++ b/README.md @@ -1,78 +1,102 @@ # Welcome User + This is my onw neovim configuration, I hope u like it ## Preview ### New Preview -![](https://github.com/sssimxn/nvim4win/blob/stable/newpreview.png) + +![](https://github.com/sssimxn/nvim4win/blob/dev/newpreview.png) ### Old Preview -![](https://github.com/sssimxn/nvim4win/blob/stable/preview.png) + +![](https://github.com/sssimxn/nvim4win/blob/dev/preview.png) + +## Install.ps1 + +A script that install everything automatically \ +*Soon* ## Support +This configuration its ready to use with these languages: + +
- + - + - + - + - + + + + + + + - + - + - + - + - - + + - + - - + + + + + + + + + - + - + @@ -85,30 +109,53 @@ This is my onw neovim configuration, I hope u like it + + + + + + + + + + + + + + + + + + + + +
LanguageLspLSP CoCExtras...Extras Issues
JavaScriptJavascript true falseAll features- All features
TypeScriptTypescripttruefalse- All features
React true falseAll features
HtmlHTML false trueAll "coc" features- All "CoC" features
CssCSS/SASS/(LESS) false trueAll "coc" features- All "CoC" features
- Sass compiler shortcut (F5)
- Less just have autocompletion
Python true falsePython compiler no setup yet- Python compiler shotcut (F5)
C/C++ true falseMinGw compilerProblems for integrated new includes- MinGW compiler shortcut (F5)
- MSVC compiler coming soon
- Conan and CMake for external libraries
- Bad linting for external libreries with CMake
Obj-C/C++truefalse- I dont used it, but i have it
Java false false Soon...A little bit hard to setup Java in (neo)vim- A little bit hard to setup Java in (neo)vim
VimScriptVimscript false true
Phptruefalse
SQLtruefalse
CMaketruefalse
+
## Requirements 1. [Git](https://git-scm.com/downloads) 2. [Node.js](https://nodejs.org/es/download/) -3. [Python3](https://www.python.org/downloads/) -4. [pynvim](https://github.com/neovim/pynvim) +3. [Python3](https://www.python.org/downloads/) +4. [pynvim](https://github.com/neovim/pynvim) 5. [Neovim nightly](https://github.com/neovim/neovim/releases/tag/nightly) To install all of this, I prefer use Chocolatey (package manager) https://chocolatey.org/install -```bash + +```powershell # Git -PS> choco install git +choco install git # Python pre-realease -PS> choco install python --pre +choco install python --pre # Node.js -PS> choco install nodejs +choco install nodejs # pynvim -PS> pip3 install pynvim +pip3 install pynvim # Neovim nightly -PS> choco install neovim --pre +choco install neovim --pre ``` ## Custom Shortcuts diff --git a/autoload/lightline/colorscheme/pinkple.vim b/autoload/lightline/colorscheme/pinkple.vim index 14260da..3da9a5a 100644 --- a/autoload/lightline/colorscheme/pinkple.vim +++ b/autoload/lightline/colorscheme/pinkple.vim @@ -1,11 +1,3 @@ -" ============================================================================= -" Filename: ./autoload/lightline/pinkple -" License: MIT License -" Author: @sssimxn -" Last Change: 2021/08/01 13:18:40 -" (based on https://github.com/cseelus/vim-colors-lucid) -" ============================================================================= - let s:rock = [ '#181320', 233 ] let s:white = [ '#f8f8f2', 234 ] let s:sky = [ '#48ff9f', 118 ] @@ -21,7 +13,7 @@ let s:p.normal.right = [ [ s:pink, s:rock ], [ s:rock, s:pink ] ] let s:p.normal.error = [ [ s:pink, s:rock ] ] let s:p.normal.warning = [ [ s:yellow, s:rock ] ] let s:p.insert.left = [ [ s:rock, s:sky ], [ s:sky, s:rock ] ] -let s:p.insert.right = [ [ s:pink, s:rock ], [ s:rock, s:sky ] ] +let s:p.insert.right = [ [ s:pink, s:rock ], [ s:rock, s:sky ] ] let s:p.visual.left = [ [ s:rock, s:yellow ], [ s:yellow, s:rock ] ] let s:p.visual.right = [ [ s:pink, s:rock ], [ s:rock, s:yellow ] ] let s:p.replace.left = [ [ s:rock, s:red ], [ s:red, s:rock ] ] @@ -34,4 +26,4 @@ let s:p.tabline.middle = [ [ s:pink, s:rock] ] let s:p.tabline.right = copy(s:p.normal.right) let s:p.tabline.tabsel = [ [ s:rock, s:pink ] ] -let g:lightline#colorscheme#pinkple#palette = lightline#colorscheme#flatten(s:p) +let g:lightline#colorscheme#purpledepth#palette = lightline#colorscheme#flatten(s:p) diff --git a/coc-settings.json b/coc-settings.json index 8c35019..47b382a 100644 --- a/coc-settings.json +++ b/coc-settings.json @@ -1,32 +1,40 @@ { - "suggest.floatEnable": true, - "suggest.enablePreview": false, - "suggest.noselect": false, - "coc.preferences.formatOnType": true, - "coc.preferences.formatOnSaveFiletypes": [ - "javascript", - "json", - "javascriptreact", - "typescript.tsx", - "css", - "html", - "xhtml", - "xml", - "python" - ], - "prettier.printWidth": 100, - "prettier.tabWidth": 3, - "prettier.singleQuote": true, - "prettier.trailingComma": "es5", - "prettier.bracketSpacing": true, - "prettier.jsxBracketSameLine": false, - "prettier.parser": "flow", - "prettier.semi": false, - "prettier.useTabs": true, - "prettier.proseWrap": "preserve", - "prettier.arrowParens": "avoid", - - "diagnostic.errorSign": "", - "diagnostic.warningSign": "", - "diagnostic.infoSign": "" + "codeLens.enable": true, + "diagnostic.errorSign": "", + "diagnostic.warningSign": "", + "diagnostic.infoSign": "", + "diagnostic.enableMessage": "jump", + "diagnostic.virtualText": false, + "diagnostic.virtualTextCurrentLineOnly": false, + "suggest.noselect": true, + "suggest.enablePreselect": true, + "suggest.completionItemKindLabels": { + "keyword": "\uf1de", //  sliders + "variable": "\ue79b", //  isometric box + "value": "\uf89f", //  digits 123 + "operator": "\u03a8", // Ψ greek letter psi + "constructor": "\uf0ad", //  wrench + "function": "\u0192", // ƒ latin small letter F + "reference": "\ufa46", // 渚 retweet symbol + "constant": "\uf8fe", //  greek letter pi + "method": "\uf09a", //  facebook "f" + "struct": "\ufb44", // פּ file tree + "class": "\uf0e8", //  hierarchy / site map + "interface": "\uf417", //  git commit / line interrupted by circle + "text": "\ue612", //  left-justified lines + "enum": "\uf02c", //  pair of tags + "enumMember": "\uf02b", //  tag + "module": "\uf40d", //  code file / page showing angle brackets + "color": "\ue22b", //  palette + "property": "\ue624", //  predator dots + "field": "\uf9be", // 料 left-justified sorted lines + "unit": "\uf475", //  negative-space ellipsis + "event": "\ufacd", // 鬒 clock alert / clock with exclamation mark + "file": "\uf15b", //  file / blank page + "folder": "\uf07b", //  folder + "snippet": "\ue60b", //  pair of curly braces + "typeParameter": "\uf728", //  file presentation box + "default": "\uf29c" //  question mark in circle + }, + "snippets.userSnippetsDirectory": "~/AppData/Local/nvim/snippets" } diff --git a/colors/pinkple.vim b/colors/pinkple.vim deleted file mode 100644 index 9c6fa3c..0000000 --- a/colors/pinkple.vim +++ /dev/null @@ -1,247 +0,0 @@ -:let _rock_dark = '#0f0c14' -:let _rock = '#181320' -:let _rock_medium = '#36323d' -:let _gray_dark = '#534d5e' -:let _gray = '#847d91' -:let _gray_medium = '#beb8cc' -:let _gray_light = '#d2c3ef' -:let _cloud = '#e4e0ed' - -:let _turquoise = '#9154E4' -:let _fluoric = '#00a5d1' -:let _cyan = '#99feff' -:let _steel = '#f8f8f2' -:let _powder = '#8fc7db' -:let _purple = '#7470ce' -:let _sky = '#48ff9f' -:let _pink = '#f92672' -:let _sap = '#fde9a2' - -set background=dark -highlight clear - -if exists("syntax_on") - syntax reset -endif - -"source ~/AppData/Local/nvim/colors/ui/tabline.vim -"if exists("+showtabline") - ":call CustomTabline() -"endif - -set t_Co=256 -let colors_name = "pinkple" -let colorgroup = {} - - -" Interface (dark) -------------------------------------------------------- -let colorgroup['Normal'] = {"GUIFG": _cloud, "GUIBG": _rock_dark} -" ------------------------------------------------------------------------- -let colorgroup['Darker'] = {"GUIFG": _gray, "GUIBG": _rock_dark} -let colorgroup['ColorColumn'] = {"GUIFG": _rock_dark, "GUIBG": _pink} -let colorgroup['Conceal'] = {"GUIFG": _sap, "GUI": "bold"} -let colorgroup['CursorLine'] = {"GUIFG": _cloud, "GUIBG": _rock} -let colorgroup['CursorLineNr'] = {"GUIFG": _gray_dark, "GUIBG": _rock_dark} -let colorgroup['Directory'] = {"GUIFG": _fluoric, "GUIBG": _rock_dark} -let colorgroup['Error'] = {"GUIFG": _rock_dark, "GUIBG": _pink} -let colorgroup['ErrorMsg'] = {"GUIFG": _rock_dark, "GUIBG": _pink} -let colorgroup['FoldColumn'] = { "GUIBG": _rock_dark} -let colorgroup['Folded'] = {"GUIFG": _cloud, "GUIBG": _rock} -let colorgroup['LineNr'] = {"GUIFG": _rock_medium, "GUIBG": _rock_dark} -" Syntax ------------------------------------------------------------------ -let colorgroup['Access'] = {"GUIFG": _purple, "GUI": "bold"} -let colorgroup['Comment'] = {"GUIFG": _gray, "GUI": "italic"} -let colorgroup['Class'] = {"GUIFG": _pink, "GUI": "italic"} -let colorgroup['Conditional'] = {"GUIFG": _cyan} -let colorgroup['Constant'] = {"GUIFG": _turquoise, "GUI": "bold"} -let colorgroup['Delimiter'] = {"GUIFG": _pink} -let colorgroup['Function'] = {"GUIFG": _steel} -let colorgroup['Identifier'] = {"GUIFG": _sky} -let colorgroup['Module'] = {"GUIFG": _pink, "GUI": "underline"} -let colorgroup['NonText'] = {"GUIFG": _rock_dark} " ~ -let colorgroup['Number'] = {"GUIFG": _turquoise} -let colorgroup['PreProc'] = {"GUIFG": _pink} -let colorgroup['Statement'] = {"GUIFG": _turquoise} -let colorgroup['Special'] = {"GUIFG": _pink} -let colorgroup['SpecialKey'] = {"GUIFG": _gray_light} -let colorgroup['String'] = {"GUIFG": _fluoric} -let colorgroup['StorageClass'] = {"GUIFG": _cloud, "GUI": "bold"} -let colorgroup['Structure'] = {"GUIFG": _gray_medium} -let colorgroup['Symbol'] = {"GUIFG": _sky} -let colorgroup['Type'] = {"GUIFG": _steel} -let colorgroup['Underlined'] = {"GUIFG": _turquoise, "GUI": "underline"} -let colorgroup['Userdef'] = {"GUIFG": _sap} -let colorgroup['MatchParen'] = {"GUIFG": _rock_dark, "GUIBG": _pink} -let colorgroup['ModeMsg'] = {"GUIFG": _rock_dark, "GUIBG": _turquoise} -let colorgroup['Pmenu'] = {"GUIFG": _cloud, "GUIBG": _rock_medium} -let colorgroup['PmenuSel'] = {"GUIFG": _rock_dark, "GUIBG": _turquoise} -let colorgroup['PmenuSbar'] = { "GUIBG": _rock_dark} -let colorgroup['Search'] = { "GUIBG": _gray_dark, "GUI": "underline"} -let colorgroup['SignColumn'] = { "GUIBG": _rock_dark} -let colorgroup['StatusLine'] = {"GUIFG": _gray, "GUIBG": _rock} -let colorgroup['StatusLineNC'] = {"GUIFG": _gray_dark, "GUIBG": _rock} -let colorgroup['Title'] = {"GUIFG": _pink, "GUI": "bold"} -let colorgroup['Todo'] = {"GUIFG": _rock_dark, "GUIBG": _powder} -let colorgroup['VertSplit'] = {"GUIFG": _rock, "GUIBG": _rock} -let colorgroup['Visual'] = {"GUIFG": _rock_dark, "GUIBG": _sap} - -" ------------------------------------ -hi link Boolean Number -hi link Character Function -hi link ErrorMsg Error -hi link Debug Special -hi link Define PreProc -hi link Exception PreProc -hi link Float Number -hi link Include Function -hi link Label Statement -hi link Macro PreProc -hi link Operator PreProc -hi link PreCondit PreProc -hi link Repeat Statement -hi link SpecialChar Special -hi link SpecialComment Special -hi link Typedef Type -hi link Tag Special - - -" Plugins ----------------------------- - -" Git Gutter -hi GitGutterAdd guifg=#1fff8e ctermfg=Green -hi GitGutterChange guifg=#f3ff41 ctermfg=Yellow -hi GitGutterDelete guifg=#ff6b41 ctermfg=Red - -" NERDtree -hi link NerdTreeCWD Statement -hi link NerdTreeHelpKey Function -hi link NerdTreeHelpTitle Statement -hi link NerdTreeOpenable Statement -hi link NerdTreeClosable Statement -hi link NerdTreeDir Normal -hi link NerdTreeDirSlash Statement - -" Language ----------------------------- - -" C++ -hi def link cppSTLbool Boolean -hi def link cppStatement Statement -hi def link cppSTLfunction Function -hi def link cppSTLdefine Constant -hi def link cppSTLconstant Constant -hi def link cppSTLnamespace Constant -hi def link cppSTLexception Type -hi def link cppSTLiterator Type -hi def link cppSTLtype Type -hi def link cppSTLtypedef Typedef -hi def link cppSTLenum Typedef -hi def link cppSTLios Function -hi def link cppSTLconcept Typedef -hi def link cppSTLvariable Identifier - -" JavaScript -hi link javascriptFuncArg Function -hi link javascriptFuncComma Function -hi link javascriptFuncDef Statement -hi link javascriptFuncKeyword Statement -hi link javascriptOpSymbols Type -hi link javascriptParens Function -hi link javascriptEndcolons Function - -" JSON -hi link jsonKeyword Function - -" PHP -hi link phpParent Normal -hi link phpRegion Comment -hi link phpVarSelector Identifier - -" Markdown -hi link mkdBlockquote Symbol -hi link mkdCode Identifier -hi link mkdIndentCode Identifier -hi link mkdLink Normal - -" XML -hi link xmlEndTag Function - -" HTML -"hi link htmlArg Symbol -"hi link htmlTag Constant -hi link htmlTagName Constant -"hi link htmlEndTag Function - -" CSS -hi link cssAttr String -hi link cssClass Type -hi link cssProp Identifier -hi link cssSelectorOp Identifier - -" Expand colorgroup ------------------------------------------ - -let s:colors = {} -let valid_cterm_colors = - \ [ - \ 'Black', 'DarkBlue', 'DarkGreen', 'DarkCyan', - \ 'DarkRed', 'DarkMagenta', 'Brown', 'DarkYellow', - \ 'LightGray', 'LightGrey', 'Gray', 'Grey', - \ 'DarkGray', 'DarkGrey', 'Blue', 'LightBlue', - \ 'Green', 'LightGreen', 'Cyan', 'LightCyan', - \ 'Red', 'LightRed', 'Magenta', 'LightMagenta', - \ 'Yellow', 'LightYellow', 'White', - \ ] -for key in keys(colorgroup) - let s:colors = colorgroup[key] - if has_key(s:colors, 'TERM') - let term = s:colors['TERM'] - else - let term = 'NONE' - endif - if has_key(s:colors, 'GUI') - let gui = s:colors['GUI'] - else - let gui='NONE' - endif - if has_key(s:colors, 'GUIFG') - let guifg = s:colors['GUIFG'] - else - let guifg='NONE' - endif - if has_key(s:colors, 'GUIBG') - let guibg = s:colors['GUIBG'] - else - let guibg='NONE' - endif - if has_key(s:colors, 'CTERM') - let cterm = s:colors['CTERM'] - else - let cterm=gui - endif - if has_key(s:colors, 'CTERMFG') - let ctermfg = s:colors['CTERMFG'] - else - if index(valid_cterm_colors, guifg) != -1 - let ctermfg=guifg - else - let ctermfg='Blue' - endif - endif - if has_key(s:colors, 'CTERMBG') - let ctermbg = s:colors['CTERMBG'] - else - if index(valid_cterm_colors, guibg) != -1 - let ctermbg=guibg - else - let ctermbg='NONE' - endif - endif - if has_key(s:colors, 'GUISP') - let guisp = s:colors['GUISP'] - else - let guisp='NONE' - endif - - if key =~ '^\k*$' - execute "hi ".key." term=".term." cterm=".cterm." gui=".gui." ctermfg=".ctermfg." guifg=".guifg." ctermbg=".ctermbg." guibg=".guibg." guisp=".guisp - endif -endfor diff --git a/colors/purpledepth.vim b/colors/purpledepth.vim new file mode 100644 index 0000000..52ab865 --- /dev/null +++ b/colors/purpledepth.vim @@ -0,0 +1,584 @@ +:let _rock_dark = '#0d1117' +:let _rock = '#181320' +:let _rock_medium = '#36323d' +:let _gray_dark = '#534d5e' +:let _gray = '#847d91' +:let _gray_medium = '#beb8cc' +:let _gray_light = '#d2c3ef' +:let _cloud = '#e4e0ed' + +:let _turquoise = '#9154E4' +:let _fluoric = '#00a5d1' +:let _cyan = '#99feff' +:let _steel = '#f8f8f2' +:let _powder = '#8fc7db' +:let _purple = '#7470ce' +:let _sky = '#48ff9f' +:let _pink = '#f92672' +:let _sap = '#fde9a2' + +set background=dark + +if exists("syntax_on") + syntax reset + highlight clear +endif + +call GlobalTabline() +call GlobalStatusline() + +set t_Co=256 +let colors_name = "purpledepth" +let colorgroup = {} + +" Interface (dark) -------------------------------------------------------- +let colorgroup['Normal'] = {"GUIFG": _cloud, "GUIBG": _rock_dark} +" ------------------------------------------------------------------------- +let colorgroup['Darker'] = {"GUIFG": _gray, "GUIBG": _rock_dark} +let colorgroup['ColorColumn'] = {"GUIFG": _rock_dark, "GUIBG": _pink} +let colorgroup['Conceal'] = {"GUIFG": _sap, "GUI": "bold"} +let colorgroup['CursorLine'] = {"GUIBG": _rock} +let colorgroup['CursorLineNr'] = {"GUIFG": _gray_dark, "GUIBG": _rock_dark} +let colorgroup['Directory'] = {"GUIFG": _fluoric, "GUIBG": _rock_dark} +let colorgroup['Error'] = {"GUIFG": _rock_dark, "GUIBG": _pink} +let colorgroup['ErrorMsg'] = {"GUIFG": _rock_dark, "GUIBG": _pink} +let colorgroup['FoldColumn'] = { "GUIBG": _rock_dark} +let colorgroup['Folded'] = {"GUIFG": _cloud, "GUIBG": _rock} +let colorgroup['LineNr'] = {"GUIFG": _rock_medium, "GUIBG": _rock_dark} +let colorgroup['Pmenu'] = {"GUIFG": _cloud, "GUIBG": _rock_medium} +let colorgroup['PmenuSel'] = {"GUIFG": _rock_dark, "GUIBG": _turquoise} +let colorgroup['PmenuSbar'] = { "GUIBG": _rock_dark} +let colorgroup['Underlined'] = {"GUIFG": _turquoise, "GUI": "underline"} +let colorgroup['NonText'] = {"GUIFG": _rock_medium} " ~ + +" Expand colorgroup ------------------------------------------ +let s:colors = {} +let valid_cterm_colors = + \ [ + \ 'Black', 'DarkBlue', 'DarkGreen', 'DarkCyan', + \ 'DarkRed', 'DarkMagenta', 'Brown', 'DarkYellow', + \ 'LightGray', 'LightGrey', 'Gray', 'Grey', + \ 'DarkGray', 'DarkGrey', 'Blue', 'LightBlue', + \ 'Green', 'LightGreen', 'Cyan', 'LightCyan', + \ 'Red', 'LightRed', 'Magenta', 'LightMagenta', + \ 'Yellow', 'LightYellow', 'White', + \ ] +for key in keys(colorgroup) + let s:colors = colorgroup[key] + if has_key(s:colors, 'TERM') + let term = s:colors['TERM'] + else + let term = 'NONE' + endif + if has_key(s:colors, 'GUI') + let gui = s:colors['GUI'] + else + let gui='NONE' + endif + if has_key(s:colors, 'GUIFG') + let guifg = s:colors['GUIFG'] + else + let guifg='NONE' + endif + if has_key(s:colors, 'GUIBG') + let guibg = s:colors['GUIBG'] + else + let guibg='NONE' + endif + if has_key(s:colors, 'CTERM') + let cterm = s:colors['CTERM'] + else + let cterm=gui + endif + if has_key(s:colors, 'CTERMFG') + let ctermfg = s:colors['CTERMFG'] + else + if index(valid_cterm_colors, guifg) != -1 + let ctermfg=guifg + else + let ctermfg='Blue' + endif + endif + if has_key(s:colors, 'CTERMBG') + let ctermbg = s:colors['CTERMBG'] + else + if index(valid_cterm_colors, guibg) != -1 + let ctermbg=guibg + else + let ctermbg='NONE' + endif + endif + if has_key(s:colors, 'GUISP') + let guisp = s:colors['GUISP'] + else + let guisp='NONE' + endif + + if key =~ '^\k*$' + execute "hi ".key." term=".term." cterm=".cterm." gui=".gui." ctermfg=".ctermfg." guifg=".guifg." ctermbg=".ctermbg." guibg=".guibg." guisp=".guisp + endif +endfor + +let Italic = "" +if exists('g:spaceduck_italic') + let Italic = "italic" +endif +let g:spaceduck_italic = get(g:, 'spaceduck_italic', 0) + +let Bold = "" +if exists('g:spaceduck_bold') + let Bold = "bold" +endif + +let g:spaceduck_bold = get(g:, 'spaceduck_bold', 0) +hi link NonText EndOfBuffer +hi PmenuThumb guifg=NONE ctermfg=NONE guibg=#686f9a ctermbg=60 gui=NONE cterm=NONE +hi QuickFixLine guifg=#ecf0c1 ctermfg=255 guibg=#16172d ctermbg=234 gui=NONE cterm=NONE +hi Search guifg=#ffffff ctermfg=15 guibg=#686f9a ctermbg=60 gui=NONE cterm=NONE +hi SpecialKey guifg=#e39400 ctermfg=172 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi SpellBad guifg=#e33400 ctermfg=166 guibg=NONE ctermbg=NONE gui=underline cterm=underline +hi SpellLocal guifg=#ecf0c1 ctermfg=255 guibg=NONE ctermbg=NONE gui=underline cterm=underline +hi SpellCap guifg=#5ccc96 ctermfg=78 guibg=NONE ctermbg=NONE gui=underline cterm=underline +hi SpellRare guifg=#f2ce00 ctermfg=220 guibg=NONE ctermbg=NONE gui=underline cterm=underline +hi StatusLine guifg=#ecf0c1 ctermfg=255 guibg=#0f111b ctermbg=233 gui=reverse cterm=reverse +hi link StatusLineTerm StatusLine +hi StatusLineTermNC guifg=#000000 ctermfg=0 guibg=#30365F ctermbg=237 gui=reverse cterm=reverse +hi link StatusLineNC StatusLineTermNC +hi TabLine guifg=#000000 ctermfg=0 guibg=#818596 ctermbg=102 gui=NONE cterm=NONE +hi Visual guifg=NONE ctermfg=NONE guibg=#1b1c36 ctermbg=234 gui=NONE cterm=NONE +hi link VisualNOS Visual +hi link Whitespace EndOfBuffer +hi Comment guifg=#30365F ctermfg=237 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Constant guifg=#f2ce00 ctermfg=220 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Identifier guifg=#00a3cc ctermfg=38 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Statement guifg=#5ccc96 ctermfg=78 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi PreProc guifg=#b3a1e6 ctermfg=146 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Type guifg=#ce6f8f ctermfg=168 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Special guifg=#b3a1e6 ctermfg=146 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Ignore guifg=#e33400 ctermfg=166 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Delimiter guifg=#ecf0c1 ctermfg=255 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Operator guifg=#ce6f8f ctermfg=168 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Tag guifg=#b3a1e6 ctermfg=146 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Debug guifg=#b3a1e6 ctermfg=146 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi StorageClass guifg=#b3a1e6 ctermfg=146 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi String guifg=#00a3cc ctermfg=38 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Structure guifg=#00a3cc ctermfg=38 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Typedef guifg=#00a3cc ctermfg=38 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Function guifg=#5ccc96 ctermfg=78 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Include guifg=#5ccc96 ctermfg=78 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Label guifg=#5ccc96 ctermfg=78 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Exception guifg=#e39400 ctermfg=172 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Keyword guifg=#e39400 ctermfg=172 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi SpecialChar guifg=#e39400 ctermfg=172 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Boolean guifg=#f2ce00 ctermfg=220 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Character guifg=#f2ce00 ctermfg=220 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Float guifg=#f2ce00 ctermfg=220 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Number guifg=#f2ce00 ctermfg=220 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Conditional guifg=#5ccc96 ctermfg=78 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Repeat guifg=#5ccc96 ctermfg=78 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Title guifg=#7a5ccc ctermfg=98 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Define guifg=#7a5ccc ctermfg=98 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi Macro guifg=#7a5ccc ctermfg=98 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi PreCondit guifg=#7a5ccc ctermfg=98 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi link SpecialComment Comment +hi Todo guifg=#ffffff ctermfg=15 guibg=#686f9a ctermbg=60 gui=underline cterm=underline +hi link cFormat Title +hi link cCppOutIf1 Normal +hi link cCppOutIf2 Normal +hi link cBracket Title +hi link cssBraces Normal +hi cssSelectorOp guifg=#ce6f8f ctermfg=168 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi link fortranType Tag +hi link fortranStructure Structure +hi link fortranStorageClass StorageClass +hi link fortranUnitHeader Title +hi link haskellType Tag +hi link haskellIdentifier Label +hi link haskellKeyword Boolean +hi link haskellDecl Boolean +hi link htmlTagName Function +hi link htmlEndTag Conditional +hi link htmlArg Tag +hi link htmlSpecialTagName Type +hi link javaClassDecl Structure +hi link javaTypeDef Keyword +hi link jsStorageClass Title +hi link jsFunction Function +hi link jsFuncName Special +hi link jsOperator Operator +hi link jsNull Constant +hi link jsGlobalObjects Constant +hi link jsFuncCall Function +hi link jsOperatorKeyword Operator +hi link jsExceptions Error +hi link jsObjectProp Tag +hi link jsTernaryIfOperator Title +hi link jsTemplateBraces Title +hi link jsTemplateExpression String +hi link texTypeStyle Special +hi link mkdDelimiter Normal +hi link phpFunction Function +hi link phpMethod Function +hi link phpType Constant +hi link phpIdentifier Type +hi link phpStringSingle String +hi link phpStringDouble String +hi pythonOperator guifg=#ce6f8f ctermfg=168 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi link rubyConstant Constant +hi link rubyDefine Define +hi link rubyMethodName Function +hi link rubyInstanceVariable Tag +hi link rubyKeywordAsMethod Tag +hi link typescriptProp Tag +hi link typescriptVariable Title +hi link jsxTagName HTMLTagName +hi link jsxComponentName Tag +hi link jsxOpenPunct jsxTagName +hi link jsxClosePunct jsxOpenPunct +hi link jsxCloseString jsxClosePunct +hi link typescriptBraces Normal +hi typescriptArrowFunc guifg=#ce6f8f ctermfg=168 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE +hi link typescriptNumberStaticMethod Function +hi link typescriptNumberMethod Function +hi link typescriptStringStaticMethod Function +hi link typescriptStringMethod Function +hi link typescriptArrayStaticMethod Function +hi link typescriptArrayMethod Function +hi link typescriptObjectStaticMethod Function +hi link typescriptObjectMethod Function +hi link typescriptSymbolStaticMethod Function +hi link typescriptFunctionMethod Function +hi link typescriptMathStaticMethod Function +hi link typescriptDateStaticMethod Function +hi link typescriptDateMethod Function +hi link typescriptJSONStaticMethod Function +hi link typescriptRegExpMethod Function +hi link typescriptES6MapMethod Function +hi link typescriptES6SetMethod Function +hi link typescriptPromiseStaticMethod Function +hi link typescriptPromiseMethod Function +hi link typescriptReflectMethod Function +hi link typescriptIntlMethod Function +hi link typescriptBOMNavigatorMethod Function +hi link typescriptServiceWorkerMethod Function +hi link typescriptBOMLocationMethod Function +hi link typescriptBOMHistoryMethod Function +hi link typescriptConsoleMethod Function +hi link typescriptXHRMethod Function +hi link typescriptFileMethod Function +hi link typescriptFileReaderMethod Function +hi link typescriptFileListMethod Function +hi link typescriptBlobMethod Function +hi link typescriptURLStaticMethod Function +hi link typescriptSubtleCryptoMethod Function +hi link typescriptCryptoMethod Function +hi link typescriptHeadersMethod Function +hi link typescriptRequestMethod Function +hi link typescriptResponseMethod Function +hi link typescriptCacheMethod Function +hi link typescriptEncodingMethod Function +hi link typescriptGeolocationMethod Function +hi link typescriptPaymentMethod Function +hi link typescriptPaymentResponseMethod Function +hi link typescriptDOMNodeMethod Function +hi link typescriptDOMDocMethod Function +hi link typescriptDOMEventTargetMethod Function +hi link typescriptDOMEventMethod Function +hi link typescriptDOMStorageMethod Function +hi link typescriptDOMFormMethod Function +hi link vimGroupName Normal +hi link yamlKeyValueDelimiter Normal +hi link yamlBlockMappingKey Function +hi link vistaTag Conditional +hi link vistaIcon Identifier +hi link vistaColon Normal +hi link vistaScope Constant +hi link vistaKind Conditional +hi Sneak guifg=#000000 ctermfg=0 guibg=#f2ce00 ctermbg=220 gui=NONE cterm=NONE +hi BufferCurrent guifg=#c1c3cc ctermfg=251 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferVisible guifg=#30365F ctermfg=237 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferInactive guifg=#30365F ctermfg=237 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferTabpageFill guifg=#0f111b ctermfg=233 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferCurrentIndex guifg=#5ccc96 ctermfg=78 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferVisibleIndex guifg=#30365F ctermfg=237 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferInactiveIndex guifg=#30365F ctermfg=237 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferCurrentMod guifg=#e39400 ctermfg=172 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferVisibleMod guifg=#e39400 ctermfg=172 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferInactiveMod guifg=#e39400 ctermfg=172 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferCurrentSign guifg=#5ccc96 ctermfg=78 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferVisibleSign guifg=#30365F ctermfg=237 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferInactiveSign guifg=#30365F ctermfg=237 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferCurrentTarget guifg=#ce6f8f ctermfg=168 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferVisibleTarget guifg=#ce6f8f ctermfg=168 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE +hi BufferInactiveTarget guifg=#ce6f8f ctermfg=168 guibg=#0f111b ctermbg=233 gui=NONE cterm=NONE + +" Git Gutter +hi GitGutterAdd guifg=#1fff8e ctermfg=Green +hi GitGutterChange guifg=#f3ff41 ctermfg=Yellow +hi GitGutterDelete guifg=#ff6b41 ctermfg=Red + +function! GlobalTabline() + hi TablineFiletype cterm=none gui=none ctermbg=none ctermfg=5 guibg=none guifg=#33cccc + hi TablineFiletypeIcon cterm=none gui=none ctermbg=5 ctermfg=0 guibg=#33cccc guifg=#272c38 + hi TablineFiletypeBody cterm=none gui=none ctermbg=8 ctermfg=5 guibg=#272c38 guifg=#33cccc + hi TablineFiletypeSeparator cterm=none gui=none ctermbg=none ctermfg=8 guibg=none guifg=#272c38 + + function! FiletypeIcon() + return winwidth(0) > 10 ? (strlen(&filetype) ? WebDevIconsGetFileTypeSymbol() . ' ' : ' ') : '' + endfunction + + function! SetTabline() + let tabline = "" + let tabline .= "%#TablineFiletype#" + let tabline .= "%#TablineFiletypeIcon#%{FiletypeIcon()}" + let tabline .= "%#TablineFiletypeBody# %t %m" + let tabline .= "%#TablineFiletypeSeparator#\ " + return tabline + endfunction + + setlocal tabline=%!SetTabline() +endfunction + +function! GlobalStatusline() + set noshowmode + set laststatus=2 + + function! RedrawModeColors(mode) " {{{ + " Normal mode + if a:mode == 'n' + hi CustomStatuslineAccent cterm=none gui=none ctermbg=none ctermfg=1 guibg=none guifg=#fc8993 + hi CustomStatuslineAccentBody cterm=none gui=none ctermbg=1 ctermfg=0 guibg=#fc8993 guifg=#272c38 + hi CustomStatuslineFilename cterm=none gui=none ctermbg=8 ctermfg=251 guibg=#272c38 guifg=#fc8993 + " Insert mode + elseif a:mode == 'i' + hi CustomStatuslineAccent cterm=none gui=none ctermbg=none ctermfg=2 guibg=none guifg=#8de19f + hi CustomStatuslineAccentBody cterm=none gui=none ctermbg=2 ctermfg=0 guibg=#8de19f guifg=#272c38 + hi CustomStatuslineFilename cterm=none gui=none ctermbg=8 ctermfg=251 guibg=#272c38 guifg=#8de19f + " Replace mode + elseif a:mode == 'R' + hi CustomStatuslineAccent cterm=none gui=none ctermbg=none ctermfg=1 guibg=none guifg=#A65169 + hi CustomStatuslineAccentBody cterm=none gui=none ctermbg=1 ctermfg=0 guibg=#A65169 guifg=#272c38 + hi CustomStatuslineFilename cterm=none gui=none ctermbg=8 ctermfg=251 guibg=#272c38 guifg=#A65169 + " Visual mode + elseif a:mode == 'v' || a:mode == 'V' || a:mode == "\" + hi CustomStatuslineAccent cterm=none gui=none ctermbg=none ctermfg=7 guibg=none guifg=#a7bdfb + hi CustomStatuslineAccentBody cterm=none gui=none ctermbg=7 ctermfg=0 guibg=#a7bdfb guifg=#272c38 + hi CustomStatuslineFilename cterm=none gui=none ctermbg=8 ctermfg=7 guibg=#272c38 guifg=#a7bdfb + " Command mode + elseif a:mode == 'c' + hi CustomStatuslineAccent cterm=none gui=none ctermbg=none ctermfg=6 guibg=none guifg=#ee828c + hi CustomStatuslineAccentBody cterm=none gui=none ctermbg=6 ctermfg=0 guibg=#ee828c guifg=#272c38 + hi CustomStatuslineFilename cterm=none gui=none ctermbg=8 ctermfg=6 guibg=#272c38 guifg=#ee828c + " Terminal mode + elseif a:mode == 't' + hi CustomStatuslineAccent cterm=none gui=none ctermbg=none ctermfg=3 guibg=none guifg=#fbdf90 + hi CustomStatuslineAccentBody cterm=none gui=none ctermbg=3 ctermfg=0 guibg=#fbdb90 guifg=#272c38 + hi CustomStatuslineFilename cterm=none gui=none ctermbg=8 ctermfg=3 guibg=#272c38 guifg=#fbdb90 + endif + return '' + endfunction + " }}} + function! ModeIcon(mode) " {{{ + " Normal mode + if a:mode == 'n' + return '煮' + " Insert mode + elseif a:mode == 'i' + return ' ' + " Replace mode + elseif a:mode == 'R' + return ' ' + " Visual mode + elseif a:mode == 'v' + return ' ' + elseif a:mode == 'V' + return ' ' + elseif a:mode == "\" + return '礪' + " Command mode + elseif a:mode == 'c' + return '⌘ ' + " Terminal mode + elseif a:mode == 't' + return 'ﰣ' + endif + return '' + endfunction + + function! SetModifiedSymbol(modified) " {{{ + if a:modified == 1 + hi CustomStatuslineModifiedBody cterm=none gui=none ctermbg=1 ctermfg=0 guibg=none guifg=#ff0000 + hi CustomStatuslineModified cterm=none gui=none ctermbg=none ctermfg=1 guibg=none guifg=none + else + hi CustomStatuslineModifiedBody cterm=none gui=none ctermbg=0 ctermfg=2 guibg=none guifg=#89e19c + hi CustomStatuslineModified cterm=none gui=none ctermbg=0 ctermfg=0 guibg=none guifg=none + endif + return '  ' + endfunction + + function! FiletypeIcon() + return winwidth(0) > 30 ? (strlen(&filetype) ? WebDevIconsGetFileTypeSymbol() . ' ' : ' ') : '' + endfunction + function! SetFiletype(filetype) " {{{ + if winwidth(0) > 30 + hi CustomStatuslineFiletype cterm=none gui=none ctermbg=none ctermfg=5 guibg=none guifg=#d990cd + hi CustomStatuslineFiletypeIcon cterm=none gui=none ctermbg=5 ctermfg=0 guibg=#d990cd guifg=#272c38 + hi CustomStatuslineFiletypeBody cterm=italic gui=italic ctermbg=8 ctermfg=5 guibg=#272c38 guifg=#d990cd + hi CustomStatuslineFiletypeSeparator cterm=none gui=none ctermbg=none ctermfg=8 guibg=none guifg=#272c38 + if a:filetype == '' + return '-' + else + return a:filetype + endif + else + hi CustomStatuslineFiletype cterm=none gui=none ctermbg=none ctermfg=5 guibg=none guifg=#0F111A + hi CustomStatuslineFiletypeIcon cterm=none gui=none ctermbg=5 ctermfg=0 guibg=#0F111A guifg=#0F111A + hi CustomStatuslineFiletypeBody cterm=italic gui=italic ctermbg=5 ctermfg=5 guibg=#0F111A guifg=#0F111A + hi CustomStatuslineFiletypeSeparator cterm=none gui=none ctermbg=none ctermfg=5 guibg=none guifg=#0F111A + return '' + endif + endfunction + + function GitBranchIcon() + if strlen(FugitiveHead())>0 && winwidth(0) > 30 + hi CustomStatuslineGitbranch cterm=none gui=none ctermbg=none ctermfg=4 guibg=none guifg=#81d4ee + hi CustomStatuslineGitbranchIcon cterm=none gui=none ctermbg=4 ctermfg=0 guibg=#81d4ee guifg=#272c38 + hi CustomStatuslineGitbranchBody cterm=none gui=none ctermbg=8 ctermfg=4 guibg=#272c38 guifg=#81d4ee + hi CustomStatuslineGitbranchSeparator cterm=none gui=none ctermbg=none ctermfg=8 guibg=none guifg=#272c38 + return ' ' + else + hi CustomStatuslineGitbranch cterm=none gui=none ctermbg=none ctermfg=0 guibg=none guifg=#0F111A + hi CustomStatuslineGitbranchIcon cterm=none gui=none ctermbg=0 ctermfg=0 guibg=#0F111A guifg=#0F111A + hi CustomStatuslineGitbranchBody cterm=none gui=none ctermbg=0 ctermfg=0 guibg=#0F111A guifg=#0F111A + hi CustomStatuslineGitbranchSeparator cterm=none gui=none ctermbg=none ctermfg=0 guibg=none guifg=#0F111A + return '' + endif + endfunction + + + function! Shiftwidth() + let fname = expand('%:t') + if ! &expandtab || fname == 'ControlP' + return '-' + endif + if &shiftwidth == 0 + return &tabstop + else + return &shiftwidth + endif + endfunction + + " Setup the colors + hi StatusLine cterm=none gui=none ctermbg=8 ctermfg=3 guibg=none guifg=none + hi CustomStatuslineSeparator cterm=none gui=none ctermbg=none ctermfg=8 guibg=none guifg=#272c38 + + hi CustomStatuslinePercentage ctermfg=0 cterm=NONE ctermbg=NONE + hi CustomStatuslinePercentageBody ctermbg=0 cterm=none ctermfg=6 + + hi CustomStatuslineTotalLines cterm=none gui=none ctermbg=none ctermfg=3 guibg=none guifg=#fbdf90 + hi CustomStatuslineTotalLinesIcon cterm=none gui=none ctermbg=3 ctermfg=0 guibg=#fbdf90 guifg=#272c38 + hi CustomStatuslineTotalLinesBody cterm=none gui=none ctermbg=8 ctermfg=3 guibg=#272c38 guifg=#fbdf90 + hi CustomStatuslineTotalLinesSeparator cterm=none gui=none ctermbg=none ctermfg=8 guibg=none guifg=#272c38 + + hi CustomStatuslineInactiveDark cterm=none gui=none ctermbg=8 ctermfg=12 guibg=#44506c guifg=#a7bdfb + hi CustomStatuslineInactiveDarkSeparator cterm=none gui=none ctermbg=8 ctermfg=12 guibg=none guifg=#272c38 + hi CustomStatuslineInactiveLight cterm=none gui=none ctermbg=8 ctermfg=12 guibg=none guifg=#44506c + hi CustomStatuslineInactiveLightSeparator cterm=none gui=none ctermbg=8 ctermfg=12 guibg=none guifg=#44506c + + function! SetActiveStatusLine() + " Statusbar items + let statusline = "%{RedrawModeColors(mode())}" + " Left side items + " ======================= + let statusline .= "%#CustomStatuslineAccent#" + let statusline .= "%#CustomStatuslineAccentBody#%{ModeIcon(mode())}" + let statusline .= "%#CustomStatuslineFilename#\ %t" + let statusline .= "%#CustomStatuslineFiletypeSeparator#\ " + " Modified status + let statusline .= "%#CustomStatuslineModified#" + let statusline .= "%#CustomStatuslineModifiedBody#%{SetModifiedSymbol(&modified)}" + let statusline .= "%#CustomStatuslineModified# " + " Right side items + " ======================= + let statusline .= "%=" + " Git branch name + let statusline .= "%#CustomStatuslineGitbranch#" + let statusline .= "%#CustomStatuslineGitbranchIcon#%{GitBranchIcon()}" + let statusline .= "%#CustomStatuslineGitbranchBody#\ %{FugitiveHead()}" + let statusline .= "%#CustomStatuslineGitbranchSeparator#\ " + " Tab length + "let statusline .= "%#CustomStatuslineTotalLines#" + "let statusline .= "%#CustomStatuslineTotalLinesIcon# " + "let statusline .= "%#CUSTomStatuslineTotalLinesBody#\ %{Shiftwidth()}" + "let statusline .= "%#CustomStatuslineSeparator#" + " Padding + let statusline .= "\ " + " Current line / total number of lines + let statusline .= "%#CustomStatuslineAccent#" + let statusline .= "%#CustomStatuslineAccentBody# " + let statusline .= "%#CustomStatuslineFilename#\ \%l" + let statusline .= "\/\%#CustomStatuslineFilename#%L" + let statusline .= "%#CustomStatuslineFiletypeSeparator#" + " Padding + let statusline .= "\ " + " Filetype + let statusline .= "%#CustomStatuslineFiletype#" + let statusline .= "%#CustomStatuslineFiletypeIcon#%{FiletypeIcon()}" + let statusline .= "%#CustomStatuslineFiletypeBody#\ %{SetFiletype(&filetype)}" + let statusline .= "%#CustomStatuslineFiletypeSeparator#\ " + return statusline + endfunction + + function! SetInactiveStatusLine() + " Statusbar items + let statusline = "%{RedrawModeColors(mode())}" + " Left side items + " ======================= + let statusline .= "%#CustomStatuslineAccent#" + let statusline .= "%#CustomStatuslineAccentBody#%{ModeIcon(mode())}" + let statusline .= "%#CustomStatuslineFilename#\ %t\ " + let statusline .= "%#CustomStatuslineSeparator#\ " + " Modified status + let statusline .= "%#CustomStatuslineModified#" + let statusline .= "%#CustomStatuslineModifiedBody#%{SetModifiedSymbol(&modified)}" + let statusline .= "%#CustomStatuslineModified# " + " Right side items + " ======================= + let statusline .= "%=" + " Git branch name + let statusline .= "%#CustomStatuslineGitbranch#" + let statusline .= "%#CustomStatuslineGitbranchIcon#%{GitBranchIcon()}" + let statusline .= "%#CustomStatuslineGitbranchBody#\ %{FugitiveHead()}" + let statusline .= "%#CustomStatuslineGitbranchSeparator#\ " + " Tab length + "let statusline .= "%#CustomStatuslineTotalLines#" + "let statusline .= "%#CustomStatuslineTotalLinesIcon# " + "let statusline .= "%#CUSTomStatuslineTotalLinesBody#\ %{Shiftwidth()}" + "let statusline .= "%#CustomStatuslineSeparator#" + " Padding + let statusline .= "\ " + " Current line / total number of lines + let statusline .= "%#CustomStatuslineTotalLines#" + let statusline .= "%#CustomStatuslineTotalLinesIcon# " + let statusline .= "%#CUSTomStatuslineTotalLinesBody#\ %l" + let statusline .= "\/\%#CUSTomStatuslineTotalLinesBody#%L" + let statusline .= "%#CustomStatuslineTotalLinesSeparator#" + " Padding + let statusline .= "\ " + " Filetype + let statusline .= "%#CustomStatuslineFiletype#" + let statusline .= "%#CustomStatuslineFiletypeIcon#%{FiletypeIcon()}" + let statusline .= "%#CustomStatuslineFiletypeBody#\ %{SetFiletype(&filetype)}" + let statusline .= "%#CustomStatuslineFiletypeSeparator#\ " + return statusline + endfunction + + augroup vimrc-statusline + autocmd! + autocmd WinEnter * setlocal statusline=%!SetActiveStatusLine() + autocmd BufEnter * setlocal statusline=%!SetActiveStatusLine() + autocmd WinNew * setlocal statusline=%!SetActiveStatusLine() + autocmd WinLeave * setlocal statusline=%!SetActiveStatusLine() + augroup END + setlocal statusline=%!SetActiveStatusLine() +endfunction diff --git a/colors/sublimemonokai.vim b/colors/sublimemonokai.vim index 734ce93..44b56fe 100644 --- a/colors/sublimemonokai.vim +++ b/colors/sublimemonokai.vim @@ -1,8 +1,3 @@ -" File: monokai.vim -" Maintainer: Erich Gubler (erichdongubler) -" URL: https://github.com/erichdongubler/vim-sublime-monokai -" License: MIT - " Initialisation if !has('gui_running') && &t_Co < 256 @@ -82,7 +77,7 @@ call s:create_palette_color('black', { 'gui': '#272822', 'cterm': '234' }) call s:create_palette_color('lightblack', { 'gui': '#2D2E27', 'cterm': '235' }) call s:create_palette_color('lightblack2', { 'gui': '#383a3e', 'cterm': '236' }) call s:create_palette_color('darkblack', { 'gui': '#211F1C', 'cterm': '233' }) -call s:create_palette_color('grey', { 'gui': '#8F908A', 'cterm': '243' }) +call s:create_palette_color('grey', { 'gui': '#272822', 'cterm': '243' }) call s:create_palette_color('lightgrey', { 'gui': '#575b61', 'cterm': '237' }) call s:create_palette_color('darkgrey', { 'gui': '#64645e', 'cterm': '239' }) call s:create_palette_color('warmgrey', { 'gui': '#75715E', 'cterm': '59' }) @@ -144,8 +139,8 @@ call s:h('ErrorMsg', { 'fg': s:black, 'bg': s:red, 'format': 'sta hi! link FoldColumn SublimeDarkBlack call s:h('Folded', { 'fg': s:warmgrey, 'bg': s:darkblack }) call s:h('IncSearch', { 'format': 'reverse,underline'}) -call s:h('LineNr', { 'fg': s:grey, 'bg': s:lightblack }) -call s:h('MatchParen', { 'format': 'underline' }) +highlight! LineNr guifg=#5f5e58 guibg=#2D2E27 +highlight! MatchParen guifg=#ffffff guibg=#d9238d hi! link ModeMsg SublimeYellow hi! link MoreMsg SublimeYellow hi! link NonText SublimeLightGrey @@ -807,6 +802,39 @@ hi! link NERDTreeGitStatusModified SublimeOrange hi! link NERDTreeGitStatusRenamed SublimeOrange hi! link NERDTreeGitStatusUntracked SublimeGreen +" NvimTree +highlight NvimTreeSymlink gui=NONE guifg=LightGray guibg=LightGray +highlight NvimTreeFolderIcon gui=NONE guifg=#d03c6e guibg=#fff +highlight NvimTreeFolderName gui=NONE guifg=LightGray +highlight nvimtreerootfolder gui=NONE guifg=#c586c0 +highlight NvimTreeEmptyFolderName gui=NONE guifg=LightGray +highlight NvimTreeOpenedFolderName gui=NONE guifg=LightGray +highlight NvimTreeExecFile gui=NONE guifg=LightGray +highlight NvimTreeOpenedFile gui=NONE guifg=LightGray +highlight NvimTreeSpecialFile gui=NONE guifg=LightGray +highlight NvimTreeImageFile gui=NONE guifg=Violet +"highlight NvimTreeMarkdownFile +"hi NvimTreeIndentMarker + +highlight LspDiagnosticsError gui=NONE guifg=#cc291b +highlight LspDiagnosticsWarning gui=NONE guifg=#ded523 +highlight LspDiagnosticsInformation gui=NONE guifg=#57d5ff +highlight LspDiagnosticsHint gui=NONE guifg=#1a64db + +highlight NvimTreeGitDirty guifg=#ebbe7b +highlight NvimTreeGitStaged guifg=LightGray +highlight NvimTreeGitMerge guifg=LightGray +highlight NvimTreeGitRenamed guifg=LightGray +highlight NvimTreeGitNew guifg=#ebbe7b +"highlight NvimTreeGitDeleted guifg=Black + +"hi NvimTreeFileDirty +"hi NvimTreeFileStaged +"hi NvimTreeFileMerge +"hi NvimTreeFileRenamed +"hi NvimTreeFileNew +"hi NvimTreeFileDeleted + " PHP " Variation: It's actually a cool idea to style these to assist reading. @@ -1119,3 +1147,7 @@ hi! link zshTypes Keyword " * Semicolons in `if` blocks are `Keyword`ed in Sublime but not distinct in " Vim " * Commands aren't distinct from builtins and keywords in Vim + +hi GitGutterAdd guifg=#1fff8e ctermfg=Green +hi GitGutterChange guifg=#f3ff41 ctermfg=Yellow +hi GitGutterDelete guifg=#ff6b41 ctermfg=Red diff --git a/colors/ui/statusline.vim b/colors/ui/statusline.vim index 79667a9..9e47a54 100644 --- a/colors/ui/statusline.vim +++ b/colors/ui/statusline.vim @@ -1,6 +1,6 @@ let g:lightline = { -\ 'enable': { 'statusline': 1, 'tabline': 0 }, -\ 'active': { +\ 'enable': { 'statusline': 1, 'tabline': 0 }, +\ 'active': { \ 'left': [['mode', 'paste'], ['linter_errors', 'linter_warnings', 'linter_ok']], \ 'right': [['myfiletype'], ['lineinfo', 'percent'], ['gitbranch']] \ }, @@ -20,7 +20,7 @@ let g:lightline = { \ 'linter_errors': 'lightline#ale#errors', \ 'linter_ok': 'lightline#ale#ok' \ }, -\ 'colorscheme': 'pinkple', +\ 'colorscheme': 'purpledepth', \ 'subseparator': { \ 'left': '', \ 'right': '' diff --git a/colors/ui/tabline.vim b/colors/ui/tabline.vim index 48a1549..9d980cd 100644 --- a/colors/ui/tabline.vim +++ b/colors/ui/tabline.vim @@ -1,7 +1,5 @@ -" Custom tabline -" (Based on 'https://github.com/probe2k/bspwm_rice/blob/master/nvim/config/tabline.vim') function! CustomTabline() - + hi TablineFiletype cterm=none gui=none ctermbg=none ctermfg=5 guibg=none guifg=#f92672 hi TablineFiletypeIcon cterm=none gui=none ctermbg=5 ctermfg=0 guibg=#f92672 guifg=#0f0c14 hi TablineFiletypeBody cterm=none gui=none ctermbg=8 ctermfg=5 guibg=#181320 guifg=#f92672 diff --git a/colors/vscode.vim b/colors/vscode.vim index 228b1f1..2331172 100644 --- a/colors/vscode.vim +++ b/colors/vscode.vim @@ -1,9 +1,37 @@ -" { NvimTreeHi() -source $LOCALAPPDATA\nvim\config\luatree.vim -call NvimTreeHi() -" } - lua << EOF local vscode = require("vscode") vscode.set() EOF + +" NvimTree +highlight NvimTreeSymlink gui=NONE guifg=LightGray guibg=LightGray +highlight NvimTreeFolderIcon gui=NONE guifg=#0074c1 guibg=#fff +highlight NvimTreeFolderName gui=NONE guifg=LightGray +highlight nvimtreerootfolder gui=NONE guifg=#c586c0 +highlight NvimTreeEmptyFolderName gui=NONE guifg=LightGray +highlight NvimTreeOpenedFolderName gui=NONE guifg=LightGray +highlight NvimTreeExecFile gui=NONE guifg=LightGray +highlight NvimTreeOpenedFile gui=NONE guifg=LightGray +highlight NvimTreeSpecialFile gui=NONE guifg=LightGray +highlight NvimTreeImageFile gui=NONE guifg=Violet +"highlight NvimTreeMarkdownFile +"hi NvimTreeIndentMarker + +highlight LspDiagnosticsError gui=NONE guifg=#cc291b +highlight LspDiagnosticsWarning gui=NONE guifg=#ded523 +highlight LspDiagnosticsInformation gui=NONE guifg=#57d5ff +highlight LspDiagnosticsHint gui=NONE guifg=#1a64db + +highlight NvimTreeGitDirty guifg=#ebbe7b +highlight NvimTreeGitStaged guifg=LightGray +highlight NvimTreeGitMerge guifg=LightGray +highlight NvimTreeGitRenamed guifg=LightGray +highlight NvimTreeGitNew guifg=#ebbe7b +"highlight NvimTreeGitDeleted guifg=Black + +"hi NvimTreeFileDirty +"hi NvimTreeFileStaged +"hi NvimTreeFileMerge +"hi NvimTreeFileRenamed +"hi NvimTreeFileNew +"hi NvimTreeFileDeleted diff --git a/config/autocommands.vim b/config/autocommands.vim index d14fdb0..0fd59b9 100644 --- a/config/autocommands.vim +++ b/config/autocommands.vim @@ -1,7 +1,19 @@ "{ Auto commands + +" { Compilers +autocmd filetype cpp nnoremap :w !g++ -std=c++2a % -o %:r && %:r.exe +autocmd filetype python nnoremap :w !python % +autocmd filetype scss,sass nnoremap :w !sass % %:r.css +" } +" + +" { Indentified tsx +au BufNewFile,BufRead *.ts setlocal filetype=typescript +au BufNewFile,BufRead *.tsx setlocal filetype=typescript.tsx +" } + " Do not use smart case in command line mode, " extracted from https://goo.gl/vCTYdK -" augroup dynamic_smartcase autocmd! autocmd CmdLineEnter : set nosmartcase @@ -61,13 +73,19 @@ augroup auto_read augroup END " Auto Source -"au! BufWritePost $MYVIMRC source % +au! BufWritePost $MYVIMRC source % " Trim Whitespaces autocmd BufWritePre * :%s/\s\+$//e -" Compiler -autocmd filetype cpp nnoremap :w
:!g++ -std=c++11 %
-"autocmd filetype cpp nnoremap :w !g++ -W -Wall -s -pedantic-errors *.cpp,cc -o App.exe && App.exe +" Ts/Js syntax +autocmd BufEnter *.{js,jsx,ts,tsx} :syntax sync fromstart +autocmd BufLeave *.{js,jsx,ts,tsx} :syntax sync clear + +" Json with comments +autocmd! FileType json syntax match Comment +\/\/.\+$+ +augroup JsonToJsonc + autocmd! FileType json set filetype=jsonc +augroup END " } diff --git a/config/bufferline.lua b/config/bufferline.lua index 59714c2..9a0a499 100644 --- a/config/bufferline.lua +++ b/config/bufferline.lua @@ -1,18 +1,26 @@ vim.opt.termguicolors = true --- Buffer line setup require'bufferline'.setup{ options = { indicator_icon = ' ', - buffer_close_icon = '', - modified_icon = '●', - close_icon = '', - close_command = "bdelete %d", + buffer_close_icon = '', + modified_icon = '●', + close_icon = '', + close_command = "bdelete! %d", right_mouse_command = "bdelete! %d", left_trunc_marker = '', - right_trunc_marker = '', + right_trunc_marker = '', offsets = {{filetype = "NvimTree", text = "EXPLORER", text_align = "center"}}, show_tab_indicators = true, - show_close_icon = false + max_name_length = 18, + max_prefix_length = 15, + tab_size = 20, + diagnostics = "coc", + diagnostics_update_in_insert = false, + diagnostics_indicator = function(count, level, diagnostics_dict, context) + return "("..count..")" + end, + show_close_icon = false, + separator_style = {"|", "|"}, }, highlights = { fill = { @@ -25,21 +33,21 @@ require'bufferline'.setup{ }, buffer_visible = { gui = "", - guifg = {attribute = "fg", highlight="Normal"}, - guibg = {attribute = "bg", highlight = "Normal"} + guifg = {attribute = "fg", highlight="Normal"}, + guibg = {attribute = "bg", highlight = "Normal"} }, buffer_selected = { gui = "", - guifg = {attribute = "fg", highlight="Normal"}, - guibg = {attribute = "bg", highlight = "Normal"} + guifg = {attribute = "fg", highlight="Normal"}, + guibg = {attribute = "bg", highlight = "Normal"} }, separator = { guifg = {attribute = "bg", highlight = "Normal"}, guibg = {attribute = "bg", highlight = "StatusLine"}, }, separator_selected = { - guifg = {attribute = "fg", highlight="Special"}, - guibg = {attribute = "bg", highlight = "Normal"} + guifg = {attribute = "fg", highlight="Special"}, + guibg = {attribute = "bg", highlight = "Normal"} }, separator_visible = { guifg = {attribute = "fg", highlight = "Normal"}, @@ -50,14 +58,12 @@ require'bufferline'.setup{ guibg = {attribute = "bg", highlight = "StatusLine"} }, close_button_selected = { - guifg = {attribute = "fg", highlight="normal"}, - guibg = {attribute = "bg", highlight = "normal"} + guifg = {attribute = "fg", highlight="normal"}, + guibg = {attribute = "bg", highlight = "normal"} }, close_button_visible = { - guifg = {attribute = "fg", highlight="normal"}, - guibg = {attribute = "bg", highlight = "normal"} + guifg = {attribute = "fg", highlight="normal"}, + guibg = {attribute = "bg", highlight = "normal"} }, - } } - diff --git a/config/coc-config.vim b/config/coc-config.vim index 9d07f31..edfdce5 100644 --- a/config/coc-config.vim +++ b/config/coc-config.vim @@ -1,108 +1,169 @@ -" Disable it on specifics filetype -let g:coc_filetypes_enable = [ 'vim', 'lua', 'html', 'css', 'json' ] - -function! s:disable_coc_for_type() - if index(g:coc_filetypes_enable, &filetype) == -1 - let b:coc_suggest_disable = 1 - else - let b:coc_suggest_disable = 0 - endif +let g:coc_global_extensions = [ +\ 'coc-tsserver', +\ 'coc-sql', +\ 'coc-json', +\ 'coc-css', +\ 'coc-html', +\ 'coc-python', +\ 'coc-phpls', +\ 'coc-tabnine', +\ 'coc-webpack', +\ 'coc-snippets', +\ 'coc-pairs', +\ ] + +" Set internal encoding of vim, not needed on neovim, since coc.nvim using some +" unicode characters in the file autoload/float.vim +set encoding=utf-8 + +" TextEdit might fail if hidden is not set. +set hidden + +" Some servers have issues with backup files, see #649. +set nobackup +set nowritebackup + +" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable +" delays and poor user experience. +set updatetime=300 + +" Don't pass messages to |ins-completion-menu|. +set shortmess+=c + +" Always show the signcolumn, otherwise it would shift the text each time +" diagnostics appear/become resolved. +if has("nvim-0.5.0") || has("patch-8.1.1564") + " Recently vim can merge signcolumn and number column into one + set signcolumn=number +else + set signcolumn=yes +endif + +" Use tab for trigger completion with characters ahead and navigate. +" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +" other plugin before putting this into your config. +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 -let fts = ['vim', 'lua', 'html', 'css', 'json'] -if index(fts, &filetype) == -1 - let fts = ['vim', 'lua', 'html', 'css', 'json'] - augroup CocGroup - autocmd! - autocmd BufNew,BufEnter,BufAdd,BufCreate * call s:disable_coc_for_type() - augroup end - autocmd FileType fts inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() - autocmd FileType fts inoremap pumvisible() ? "\" : "\" - - function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' - endfunction - - " Use to trigger completion. - if has('nvim') - autocmd FileType fts inoremap coc#refresh() - else - autocmd FileType fts inoremap coc#refresh() - endif - - " Make auto-select the first completion item and notify coc.nvim to - " format on enter, could be remapped by other vim plugin - autocmd FileType fts inoremap pumvisible() ? coc#_select_confirm() - \: "\u\\=coc#on_enter()\" - - " Use `[g` and `]g` to navigate diagnostics - " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. - autocmd FileType fts nmap [g (coc-diagnostic-prev) - autocmd FileType fts nmap ]g (coc-diagnostic-next) - - " GoTo code navigation. - autocmd FileType fts nmap gd (coc-definition) - autocmd FileType fts nmap gy (coc-type-definition) - autocmd FileType fts nmap gi (coc-implementation) - autocmd FileType fts nmap gr (coc-references) - - " Use K to show documentation in preview window. - autocmd FileType fts nnoremap K :call show_documentation() - - function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif - endfunction - - " Highlight the symbol and its references when holding the cursor. - "autocmd CursorHold * silent call CocActionAsync('highlight') - - " Symbol renaming. - autocmd FileType fts nmap rn (coc-rename) - - 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 - - " Add `:Format` command to format current buffer. - command! -nargs=0 Format :call CocAction('format') - - " Add `:Fold` command to fold current buffer. - command! -nargs=? Fold :call CocAction('fold', ) - - " Add `:OR` command for organize imports of the current buffer. - command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') - - " Add (Neo)Vim's native statusline support. - " NOTE: Please see `:h coc-status` for integrations with external plugins that - " provide custom statusline: lightline.vim, vim-airline. - "set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} +let g:coc_snippet_next = '' + +" Use to trigger completion. +if has('nvim') + inoremap coc#refresh() +else + inoremap coc#refresh() endif -" Prettier AutoFormat -"command! -nargs=0 Prettier :CocCommand prettier -nnoremap p Prettier :CocCommand prettier.formatFile +" Make auto-select the first completion item and notify coc.nvim to +" format on enter, could be remapped by other vim plugin +inoremap pumvisible() ? coc#_select_confirm() + \: "\u\\=coc#on_enter()\" + +" Use `[g` and `]g` to navigate diagnostics +" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. +nmap [d (coc-diagnostic-prev) +nmap ]d (coc-diagnostic-next) + +" GoTo code navigation. +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('') + elseif (coc#rpc#ready()) + call CocActionAsync('doHover') + else + execute '!' . &keywordprg . " " . expand('') + endif +endfunction + +" Highlight the symbol and its references when holding the cursor. +autocmd CursorHold * silent call CocActionAsync('highlight') + +" Symbol renaming. +nmap (coc-rename) + +" Formatting selected code. +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 + +" Applying codeAction to the selected region. +" Example: `aap` for current paragraph +xmap a (coc-codeaction-selected) +nmap a (coc-codeaction-selected) + +" Remap keys for applying codeAction to the current buffer. +nmap ac (coc-codeaction) +" Apply AutoFix to problem on the current line. +nmap qf (coc-fix-current) + +" Map function and class text objects +" NOTE: Requires 'textDocument.documentSymbol' support from the language server. +xmap if (coc-funcobj-i) +omap if (coc-funcobj-i) +xmap af (coc-funcobj-a) +omap af (coc-funcobj-a) +xmap ic (coc-classobj-i) +omap ic (coc-classobj-i) +xmap ac (coc-classobj-a) +omap ac (coc-classobj-a) + +" Remap and for scroll float windows/popups. +if has('nvim-0.4.0') || has('patch-8.2.0750') + nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" + nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" + vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" + vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" +endif + +" Add `:Format` command to format current buffer. +command! -nargs=0 Format :call CocAction('format') + +" Add `:Fold` command to fold current buffer. +command! -nargs=? Fold :call CocAction('fold', ) + +" Add `:OR` command for organize imports of the current buffer. +command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') + +" Mappings for 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 -let g:coc_global_extensions = [ -\ 'coc-vimlsp', -\ 'coc-snippets', -\ 'coc-prettier', -\ 'coc-pairs', -\ 'coc-lua', -\ 'coc-html', -\ 'coc-json', -\ 'coc-css' -\ ] diff --git a/config/lsp-config.lua b/config/lsp-config.lua deleted file mode 100644 index 0346afb..0000000 --- a/config/lsp-config.lua +++ /dev/null @@ -1,87 +0,0 @@ -local nvim_lsp = require('lspconfig') - --- Rounded Borders -vim.lsp.handlers["textDocument/hover"] = - vim.lsp.with( - vim.lsp.handlers.hover, - { - border = "single" - } -) - -vim.lsp.handlers["textDocument/signatureHelp"] = - vim.lsp.with( - vim.lsp.handlers.signature_help, - { - border = "single" - } -) - -vim.cmd [[nnoremap :lua vim.lsp.diagnostic.show_line_diagnostics({ border = "single" })]] -vim.cmd [[nnoremap ]g :lua vim.lsp.diagnostic.goto_next({ popup_opts = { border = "single" }})]] -vim.cmd [[nnoremap [g :lua vim.lsp.diagnostic.goto_prev({ popup_opts = { border = "single" }})]] - --- 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) - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - - -- Enable completion triggered by - buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- Mappings. - local opts = { noremap=true, silent=true } - - -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', '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', 'D', 'lua vim.lsp.buf.type_definition()', opts) - --buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - --buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - --buf_set_keymap('n', 'e', '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) - --buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) - -end - --- Column Signs ---local signs = { Error = "", Warning = "", Hint = "", Information = "" } -local signs = { Error = "", Warning = "", Hint = "", Information = "" } - -for type, icon in pairs(signs) do - local hl = "LspDiagnosticsSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) -end - --- LSP settings -local on_attach = function(client, bufnr) - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {border = border}) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = border}) -end - -local luacompletion = require'completion' - -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true - --- JS, TS, React, C++, Java, Python -local servers = { 'tsserver', 'clangd', 'pylsp' } -for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { - on_attach = luacompletion.on_attach, - flags = { - debounce_text_changes = 150, - }, - capabilities = capabilities - } -end diff --git a/config/lsp-config.vim b/config/lsp-config.vim deleted file mode 100644 index 3812e1d..0000000 --- a/config/lsp-config.vim +++ /dev/null @@ -1,162 +0,0 @@ -source $LOCALAPPDATA\nvim\config\lsp-config.lua - -" AutoFormat -autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100) -autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100) -"autocmd BufWritePre *.ts lua vim.lsp.buf.formatting_sync(nil, 100) -"autocmd BufWritePre *.tsx lua vim.lsp.buf.formatting_sync(nil, 100) -autocmd BufWritePre *.cpp,*.cc,*.c,*.h,*.hpp lua vim.lsp.buf.formatting_sync(nil, 100) -"autocmd BufWritePre *.java lua vim.lsp.buf.formatting_sync(nil, 100) -autocmd BufWritePre *.py lua vim.lsp.buf.formatting_sync(nil, 100) - -let g:autocomplete = get(g:, 'autocomplete', {}) -let g:completion_enable_snippet = 'UltiSnips' -let g:autocomplete.auto_hover = 1 -let g:autocomplete.auto_paren = 1 -let g:autocomplete.ignore_case = 1 -let g:autocomplete.matching = ['substring', 'fuzzy'] -let g:autocomplete.confirm_key = "" -"let g:completion_popup_border = 'rounded' - -"let g:completion_chain_complete_list = { -"\ 'default': [ -"\ {'complete_items': ['keyn', 'path', 'snippet', 'lsp', 'tabnine'] }, -"\ {'mode': ''}, -"\ {'mode': ''} -"\ ] -"\ } - -"let g:completion_tabnine_priority = 1 -let g:completion_tabnine_max_num_results = 5 - -set completeopt=menuone,noselect -set shortmess+=c - -" Lua Completion -let g:completion_menu_length = 80 -let g:completion_abbr_length = 50 -"let g:completion_kind_overrides = 0 -let g:completion_customize_lsp_label = { -\ 'Text' : 't [LS] ', -\ 'Function': 'F [LS] ', -\ 'Variable': 'V [LS] ', -\ 'Method': 'm [LS] ', -\ 'Constant': 'c [LS] ', -\ 'Struct': 's [LS] ', -\ 'Class': 'C [LS] ', -\ 'Interface':'i [LS]', -\ 'Enum': 'e [LS]', -\ 'EnumMember': 'E [LS]', -\ 'Module': 'm [LS] ', -\ 'Color': 'c [CO] ', -\ 'Property': 'p [LS] ', -\ 'Field': 'f [LS] ', -\ 'Unit': 'u [LS] ', -\ 'File': 'fi [PA] ', -\ 'Value': 'v [LS] ', -\ 'Event': 'ev [LS] ', -\ 'Folder': 'fo [PA] ', -\ 'Keyword': 'k [LS] ', -\ 'Snippet': 's [SN] ', -\ 'UltiSnips': 's [SN] ', -\ 'Operator': 'o [LS] ', -\ 'Reference': 'r [LS] ', -\ 'TypeParameter': 'tp [LS] ', -\ 'Default': 'd [DE]', -\ 'tabnine': ' [TN] ', -\ 'Path': ' [PA] ' -\ } - -" Open in every buffer -"autocmd BufEnter * lua require'completion'.on_attach() - -" Popup Diagnostic -lua << EOF -vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - signs = false, - underline = true, - update_in_insert = true, -}) -EOF - -" { LspSaga -lua << EOF -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 = ' ', - definition_preview_icon = ' ', - rename_prompt_prefix = '>', - max_preview_lines = 14, -- preview lines of lsp_finder and definition preview - border_style = "round", --single" "double" "round" "plus" - code_action_prompt = { - enable = true, - sign = true, - sign_priority = 20, - virtual_text = true, - }, - finder_action_keys = { - open = 'o', - vsplit = 's', - split = 'i', - quit = 'q', - scroll_down = '', - scroll_up = '' - }, - code_action_keys = { - quit = 'q',exec = '' - }, - rename_action_keys = { - quit = '',exec = '' -- quit can be a table - }, - server_filetype_map = { - metals = { - 'sbt', - 'scala' - } - } -} -EOF - -let ft = ['python', 'javascript', 'cpp'] -" { LspSaga Mappings -" Scroll into saga windows -autocmd FileType ft nnoremap lua require('lspsaga.action').smart_scroll_with_saga(1) -autocmd filetype ft nnoremap lua require('lspsaga.action').smart_scroll_with_saga(-1) -" Code action -autocmd filetype ft nnoremap ca :Lspsaga code_action -autocmd filetype ft vnoremap ca :Lspsaga range_code_action -"Lsp Finder -autocmd filetype ft nnoremap gh :Lspsaga lsp_finder -" Show Docs -autocmd filetype ft nnoremap K :Lspsaga hover_doc -" Signature Help -autocmd filetype ft nnoremap gs :Lspsaga signature_help -" Rename -autocmd filetype ft nnoremap gr :Lspsaga rename -" Preview -"nnoremap gd :Lspsaga preview_definition -" Diagnostic -autocmd filetype ft nnoremap cd :Lspsaga show_line_diagnostics -autocmd filetype ft nnoremap cc lua require'lspsaga.diagnostic'.show_cursor_diagnostics() -autocmd filetype ft nnoremap [d :Lspsaga diagnostic_jump_next -autocmd filetype ft nnoremap ]d :Lspsaga diagnostic_jump_prev -" Terminal -nnoremap :Lspsaga open_floaterm -tnoremap :Lspsaga close_floaterm -" } - -" { LspSaga hightlights -highlight LspSagaFinderSelection guifg=#ff0000 guibg=#00ff00 gui=bold -highlight LspSagaBorderTitle guifg=#ff0000 guibg=#00ff00 -highlight LspFloatWinBorder guifg=#ff0000 guibg=#00ff00 -" } -" } diff --git a/config/lualine.lua b/config/lualine.lua index ec08ad4..4d8efb3 100644 --- a/config/lualine.lua +++ b/config/lualine.lua @@ -5,7 +5,8 @@ local lualine = require 'lualine' -- Color table for highlights local colors = { - bg = '#0073C1', + bg = '#0073C1', + --bg = '#4f4f4f', fg = '#bbc2cf', yellow = '#ECBE7B', cyan = '#008080', @@ -19,29 +20,34 @@ local colors = { white = '#fff' } + local conditions = { - buffer_not_empty = function() return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 end, - hide_in_width = function() return vim.fn.winwidth(0) > 80 end, + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand '%:t') ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, check_git_workspace = function() - local filepath = vim.fn.expand('%:p:h') + local filepath = vim.fn.expand '%:p:h' local gitdir = vim.fn.finddir('.git', filepath .. ';') return gitdir and #gitdir > 0 and #gitdir < #filepath - end + end, } -- Config local config = { options = { -- Disable sections and component separators - component_separators = "", - section_separators = "", + component_separators = '', + section_separators = '', theme = { -- We are going to use lualine_c an lualine_x as left and -- right section. Both are highlighted by c theme . So we -- are just setting default looks o statusline - normal = {c = {fg = colors.fg, bg = colors.bg}}, - inactive = {c = {fg = colors.fg, bg = colors.bg}} - } + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, }, sections = { -- these are to remove the defaults @@ -51,16 +57,17 @@ local config = { lualine_z = {}, -- These will be filled later lualine_c = {}, - lualine_x = {} + lualine_x = {}, }, inactive_sections = { -- these are to remove the defaults + lualine_a = {}, lualine_v = {}, lualine_y = {}, lualine_z = {}, lualine_c = {}, - lualine_x = {} - } + lualine_x = {}, + }, } -- Inserts a component in lualine_c at left section @@ -75,58 +82,43 @@ end ins_left { 'branch', - icon = '', + icon = '', condition = conditions.check_git_workspace, color = {fg = colors.white, gui = 'NONE'} } - ins_left { 'diagnostics', - sources = {'nvim_lsp'}, + sources = {'coc'}, symbols = {error = ' ', warn = ' ', info = ' '}, - color_error = colors.white, + color_error = { fg = colors.white, gui = 'NONE' }, color_warn = colors.white, color_info = colors.white } +ins_left { + "mode" +} -ins_left { 'mode' } - -ins_right {'location'} +-- Add components to right sections +ins_right { + 'filename', + cond = conditions.buffer_not_empty, + color = { fg = colors.white, gui = 'bold' }, +} ins_right { 'o:encoding', -- option component same as &encoding in viml - upper = true, -- I'm not sure why it's upper case either ;) - condition = conditions.hide_in_width, - color = {fg = colors.white, gui = 'NONE'} + fmt = string.upper, -- I'm not sure why it's upper case either ;) + cond = conditions.hide_in_width, + color = { fg = colors.white, gui = 'bold' }, } +ins_right { 'progress', color = { fg = colors.fg, gui = 'bold' } } +ins_right { 'location' } ins_right { - 'filetype', - condition = conditions.buffer_not_empty, - color = {fg = colors.white, gui = 'NONE'}, - icons_enabled = false + -- filesize component + 'filesize', + cond = conditions.buffer_not_empty, } ---ins_right { - ---- filesize component - --function() - --local function format_file_size(file) - --local size = vim.fn.getfsize(file) - --if size <= 0 then return '' end - --local sufixes = {'b', 'k', 'm', 'g'} - --local i = 1 - --while size > 1024 do - --size = size / 1024 - --i = i + 1 - --end - --return string.format('%.1f%s', size, sufixes[i]) - --end - --local file = vim.fn.expand('%:p') - --if string.len(file) == 0 then return '' end - --return format_file_size(file) - --end, - --condition = conditions.buffer_not_empty ---} - -- Now don't forget to initialize lualine lualine.setup(config) diff --git a/config/luatree.vim b/config/luatree.vim index baf3d79..31aecda 100644 --- a/config/luatree.vim +++ b/config/luatree.vim @@ -1,161 +1,104 @@ -"let g:nvim_tree_side = 'right' "left by default -let g:nvim_tree_width = 32 "30 by default, can be width_in_columns or 'width_in_percent%' -let g:nvim_tree_ignore = [ 'node_modules', '.cache' ] "empty by default -let g:nvim_tree_gitignore = 1 "0 by default -let g:nvim_tree_auto_open = 1 "0 by default, opens the tree when typing `vim $DIR` or `vim` -let g:nvim_tree_auto_close = 1 "0 by default, closes the tree when it's the last window -let g:nvim_tree_auto_ignore_ft = [ 'startify', 'dashboard' ] "empty by default, don't auto open tree on specific filetypes. -let g:nvim_tree_quit_on_open = 0 "0 by default, closes the tree when you open a file -let g:nvim_tree_follow = 1 "0 by default, this option allows the cursor to be updated when entering a buffer -let g:nvim_tree_indent_markers = 1 "0 by default, this option shows indent markers when folders are open -let g:nvim_tree_hide_dotfiles = 0 "0 by default, this option hides files and folders starting with a dot `.` -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 = 0 "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_tab_open = 1 "0 by default, will open the tree when entering a new tab and the tree was previously open -let g:nvim_tree_auto_resize = 0 "1 by default, will resize the tree to its saved width when opening a file -let g:nvim_tree_disable_netrw = 1 "1 by default, disables netrw -let g:nvim_tree_hijack_netrw = 0 "1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities) -let g:nvim_tree_add_trailing = 0 "0 by default, append a trailing slash to folder names -let g:nvim_tree_group_empty = 1 " 0 by default, compact folders that only contain a single folder into one node in the file tree -let g:nvim_tree_lsp_diagnostics = 1 "0 by default, will show lsp diagnostics in the signcolumn. See :help nvim_tree_lsp_diagnostics -let g:nvim_tree_disable_window_picker = 1 "0 by default, will disable the window picker. -let g:nvim_tree_hijack_cursor = 1 "1 by default, when moving cursor in the tree, will position the cursor at the start of the file on the current line -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_update_cwd = 1 "0 by default, will update the tree cwd when changing nvim's directory (DirChanged event). Behaves strangely with autochdir set. -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_window_picker_exclude = { - \ 'filetype': [ - \ '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': 1, - \ 'files': 1, -\ 'folder_arrows': 1, - \ } -"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': "S", - \ 'unmerged': "~", - \ 'renamed': "R", - \ 'untracked': "U", - \ 'deleted': "D", - \ 'ignored': "I", - \ }, - \ 'folder': { - \ 'arrow_open': "", - \ 'arrow_closed': "", - \ 'default': "", - \ 'open': "", - \ 'empty': "", - \ 'empty_open': "", - \ 'symlink': "", - \ 'symlink_open': "", - \ }, - \ 'lsp': { - \ 'hint': "", - \ 'info': "", - \ 'warning': "", - \ 'error': "", - \ } - \ } +set termguicolors +nnoremap :NvimTreeToggle -nnoremap :NvimTreeToggle -nnoremap r :NvimTreeRefresh -nnoremap n :NvimTreeFindFile -" NvimTreeOpen, NvimTreeClose and NvimTreeFocus are als -lua <", "o", "<2-LeftMouse>"}, cb = tree_cb("edit") }, - { key = {"<2-RightMouse>", ""}, cb = tree_cb("cd") }, - { key = "", cb = tree_cb("vsplit") }, - { key = "", cb = tree_cb("split") }, - { key = "", cb = tree_cb("tabnew") }, - { key = "<", cb = tree_cb("prev_sibling") }, - { key = ">", cb = tree_cb("next_sibling") }, - { key = "P", cb = tree_cb("parent_node") }, - { key = "", cb = tree_cb("close_node") }, - { key = "", cb = tree_cb("close_node") }, - { key = "", cb = tree_cb("preview") }, - { key = "K", cb = tree_cb("first_sibling") }, - { key = "J", cb = tree_cb("last_sibling") }, - { key = "I", cb = tree_cb("toggle_ignored") }, - { key = "H", cb = tree_cb("toggle_dotfiles") }, - { key = "R", cb = tree_cb("refresh") }, - { key = "a", cb = tree_cb("create") }, - { key = "d", cb = tree_cb("remove") }, - { key = "r", cb = tree_cb("rename") }, - { key = "", cb = tree_cb("full_rename") }, - { key = "x", cb = tree_cb("cut") }, - { key = "c", cb = tree_cb("copy") }, - { key = "p", cb = tree_cb("paste") }, - { key = "y", cb = tree_cb("copy_name") }, - { key = "Y", cb = tree_cb("copy_path") }, - { key = "gy", cb = tree_cb("copy_absolute_path") }, - { key = "[c", cb = tree_cb("prev_git_item") }, - { key = "]c", cb = tree_cb("next_git_item") }, - { key = "-", cb = tree_cb("dir_up") }, - { key = "s", cb = tree_cb("system_open") }, - { key = "q", cb = tree_cb("close") }, - { key = "g?", cb = tree_cb("toggle_help") }, + { key = {"", "o", "<2-LeftMouse>"}, cb = tree_cb("edit") }, + { key = {"<2-RightMouse>", ""}, cb = tree_cb("cd") }, + { key = "", cb = tree_cb("vsplit") }, + { key = "", cb = tree_cb("split") }, + { key = "", cb = tree_cb("tabnew") }, + { key = "<", cb = tree_cb("prev_sibling") }, + { key = ">", cb = tree_cb("next_sibling") }, + { key = "P", cb = tree_cb("parent_node") }, + { key = "", cb = tree_cb("close_node") }, + { key = "", cb = tree_cb("close_node") }, + { key = "", cb = tree_cb("preview") }, + { key = "K", cb = tree_cb("first_sibling") }, + { key = "J", cb = tree_cb("last_sibling") }, + { key = "I", cb = tree_cb("toggle_ignored") }, + { key = "H", cb = tree_cb("toggle_dotfiles") }, + { key = "R", cb = tree_cb("refresh") }, + { key = "a", cb = tree_cb("create") }, + { key = "d", cb = tree_cb("remove") }, + { key = "r", cb = tree_cb("rename") }, + { key = "", cb = tree_cb("full_rename") }, + { key = "x", cb = tree_cb("cut") }, + { key = "c", cb = tree_cb("copy") }, + { key = "p", cb = tree_cb("paste") }, + { key = "y", cb = tree_cb("copy_name") }, + { key = "Y", cb = tree_cb("copy_path") }, + { key = "gy", cb = tree_cb("copy_absolute_path") }, + { key = "[c", cb = tree_cb("prev_git_item") }, + { key = "]c", cb = tree_cb("next_git_item") }, + { key = "-", cb = tree_cb("dir_up") }, + { key = "s", cb = tree_cb("system_open") }, + { key = "q", cb = tree_cb("close") }, + { key = "g?", cb = tree_cb("toggle_help") }, } EOF - -" a list of groups can be found at `:help nvim_tree_highlight` -function! NvimTreeHi() -highlight NvimTreeSymlink gui=NONE guifg=LightGray guibg=LightGray -highlight NvimTreeFolderIcon gui=NONE guifg=#0074c1 guibg=#fff -highlight NvimTreeFolderName gui=NONE guifg=LightGray -highlight nvimtreerootfolder gui=NONE guifg=#c586c0 -highlight NvimTreeEmptyFolderName gui=NONE guifg=LightGray -highlight NvimTreeOpenedFolderName gui=NONE guifg=LightGray -highlight NvimTreeExecFile gui=NONE guifg=LightGray -highlight NvimTreeOpenedFile gui=NONE guifg=LightGray -highlight NvimTreeSpecialFile gui=NONE guifg=LightGray -highlight NvimTreeImageFile gui=NONE guifg=Violet -"highlight NvimTreeMarkdownFile -"hi NvimTreeIndentMarker - -highlight LspDiagnosticsError gui=NONE guifg=#cc291b -highlight LspDiagnosticsWarning gui=NONE guifg=#ded523 -highlight LspDiagnosticsInformation gui=NONE guifg=#57d5ff -highlight LspDiagnosticsHint gui=NONE guifg=#1a64db - -highlight NvimTreeGitDirty guifg=#ebbe7b -highlight NvimTreeGitStaged guifg=LightGray -highlight NvimTreeGitMerge guifg=LightGray -highlight NvimTreeGitRenamed guifg=LightGray -highlight NvimTreeGitNew guifg=#ebbe7b -"highlight NvimTreeGitDeleted guifg=Black - -"hi NvimTreeFileDirty -"hi NvimTreeFileStaged -"hi NvimTreeFileMerge -"hi NvimTreeFileRenamed -"hi NvimTreeFileNew -"hi NvimTreeFileDeleted -endfunction -:call NvimTreeHi() +let g:nvim_tree_ignore = [ '.git' ] +let g:nvim_tree_gitignore = 1 +let g:nvim_tree_quit_on_open = 0 +let g:nvim_tree_indent_markers = 1 +let g:nvim_tree_hide_dotfiles = 1 +let g:nvim_tree_git_hl = 1 +let g:nvim_tree_highlight_opened_files = 0 +let g:nvim_tree_root_folder_modifier = ':~' +let g:nvim_tree_add_trailing = 0 +let g:nvim_tree_group_empty = 1 +let g:nvim_tree_disable_window_picker = 1 +let g:nvim_tree_icon_padding = ' ' +let g:nvim_tree_symlink_arrow = ' >> ' +let g:nvim_tree_respect_buf_cwd = 1 +let g:nvim_tree_create_in_closed_folder = 0 +let g:nvim_tree_refresh_wait = 500 +let g:nvim_tree_special_files = { 'README.md': 1, 'Makefile': 1, 'MAKEFILE': 1 } +let g:nvim_tree_show_icons = { +\ 'git': 1, +\ 'folders': 1, +\ 'files': 1, +\ 'folder_arrows': 0, +\ } +let g:nvim_tree_window_picker_exclude = { +\ 'filetype': [ +\ 'notify', +\ 'packer', +\ 'qf' +\ ], +\ 'buftype': [ +\ 'terminal' +\ ] +\ } +let g:nvim_tree_icons = { +\ 'default': '', +\ 'symlink': '', +\ 'git': { +\ 'unstaged': "●", +\ 'staged': "S", +\ 'unmerged': "~", +\ 'renamed': "R", +\ 'untracked': "U", +\ 'deleted': "D", +\ 'ignored': "?", +\ }, +\ 'folder': { +\ 'arrow_open': "", +\ 'arrow_closed': "", +\ 'default': "", +\ 'open': "", +\ 'empty': "", +\ 'empty_open': "", +\ 'symlink': "", +\ 'symlink_open': "", +\ }, +\ 'lsp': { +\ 'hint': "", +\ 'info': "", +\ 'warning': "", +\ 'error': "", +\ } +\ } diff --git a/config/plugs-config.vim b/config/plugs-config.vim index 8f5fbf4..eb2ac4f 100644 --- a/config/plugs-config.vim +++ b/config/plugs-config.vim @@ -1,27 +1,27 @@ " GitSigns lua << EOF require('gitsigns').setup { - keymaps = { - -- Default keymap options - noremap = true, + keymaps = { + -- Default keymap options + noremap = true, - ['n j'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'"}, - ['n k'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, + ['n ]g'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'"}, + ['n [g'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, - ['n hs'] = 'lua require"gitsigns".stage_hunk()', - ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', - ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', - ['n hr'] = 'lua require"gitsigns".reset_hunk()', - ['v hr'] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', - ['n hR'] = 'lua require"gitsigns".reset_buffer()', - ['n hp'] = 'lua require"gitsigns".preview_hunk()', - ['n hb'] = 'lua require"gitsigns".blame_line(true)', - ['n hS'] = 'lua require"gitsigns".stage_buffer()', - ['n hU'] = 'lua require"gitsigns".reset_buffer_index()', - -- Text objects - ['o ih'] = ':lua require"gitsigns.actions".select_hunk()', - ['x ih'] = ':lua require"gitsigns.actions".select_hunk()' - } + ['n hs'] = 'lua require"gitsigns".stage_hunk()', + ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', + ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', + ['n hr'] = 'lua require"gitsigns".reset_hunk()', + ['v hr'] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', + ['n hR'] = 'lua require"gitsigns".reset_buffer()', + ['n hp'] = 'lua require"gitsigns".preview_hunk()', + ['n hb'] = 'lua require"gitsigns".blame_line(true)', + ['n hS'] = 'lua require"gitsigns".stage_buffer()', + ['n hU'] = 'lua require"gitsigns".reset_buffer_index()', + -- Text objects + ['o ih'] = ':lua require"gitsigns.actions".select_hunk()', + ['x ih'] = ':lua require"gitsigns.actions".select_hunk()' + } } EOF @@ -31,6 +31,7 @@ let g:vimspector_enable_mappings = 'HUMAN' " Treesitter lua << EOF require "nvim-treesitter.configs".setup { + ensure_installed = "maintained", highlight = { enable = true, disable = { "vim", "lua" } @@ -43,14 +44,19 @@ EOF " Emmet let g:user_emmet_install_global = 0 -autocmd FileType xml,html,css,javascript,typescript EmmetInstall +autocmd FileType xml,html,css,javascript,javascriptreact,javascript.tsx,typescript,typescriptreact,typescript.tsx EmmetInstall + let g:user_emmet_leader_key = "," " Telescope lua << EOF require("telescope").setup { defaults = { - -- Your defaults config goes in here + mappings = { + n = { + [""] = false + } + } }, pickers = { -- Your special builtin config goes in here @@ -82,67 +88,38 @@ require("telescope").setup { } EOF -" Trouble +" Webicons & Vimicons +let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols = {} " needed +let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols['README.md'] = '' lua << EOF - 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 = "lsp_workspace_diagnostics", -- "lsp_workspace_diagnostics", "lsp_document_diagnostics", "quickfix", "lsp_references", "loclist" - fold_open = "", -- icon used for open folds - fold_closed = "", -- icon used for closed folds - 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 = "", -- cancel the preview and get back to your last window / buffer / cursor - refresh = "r", -- manually refresh - jump = {"", ""}, -- jump to the diagnostic or open / close folds - open_split = { "" }, -- open buffer in new split - open_vsplit = { "" }, -- open buffer in new vsplit - open_tab = { "" }, -- 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", -- preview 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. to close preview and go back to last window - auto_fold = false, -- automatically fold a file trouble list at creation - signs = { - -- icons / text used for a diagnostic - error = "", - warning = "", - hint = "", - information = "", - other = "﫠" - }, - use_lsp_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client +require("nvim-web-devicons").setup { + override = { + ["test.js"] = { + icon = "ﭧ", + color = "#cbcb41", + name = "JsTest" + }, + ["spec.js"] = { + icon = "", + color = "#cbcb41", + name = "JsSpec" + }, + ["test.lua"] = { + icon = "ﭧ", + color = "#51a0cf", + name = "LuaTest" + }, + ["spec.lua"] = { + icon = "", + color = "#51a0cf", + name = "LuaSpec" + }, + ["README.md"] = { + icon = "", + color = "#6bbcff", + name = "Readme" + } + }, + default = true } EOF -lua << EOF -require("lsp-colors").setup({ - Error = "#db4b4b", - Warning = "#e0af68", - Information = "#0db9d7", - Hint = "#10B981" -}) -EOF - -" Startify -let g:startify_lists = [ -\ { 'type': 'dir', 'header': [' MRU '. getcwd()] }, -\ { 'type': 'files', 'header': [' MRU'] }, -\ { 'type': 'sessions', 'header': [' Sessions'] }, -\ { 'type': 'bookmarks', 'header': [' Bookmarks'] }, -\ { 'type': 'commands', 'header': [' Commands'] }, -\ ] diff --git a/config/prettier.vim b/config/prettier.vim new file mode 100644 index 0000000..6da4b85 --- /dev/null +++ b/config/prettier.vim @@ -0,0 +1,36 @@ +" Auto-format +"let g:prettier#autoformat = 0 +"autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html,*.xml Prettier + +" Manual-format +nnoremap P :Prettier +nnoremap Pc :PrettierCli + +" Stylesheets prettier +au FileType css,scss,sass,less let b:prettier_exec_cmd = "prettier-stylelint" + +"let g:prettier#autoformat_config_files = [] +"let g:prettier#exec_cmd_path = "~/path/to/cli/prettier" + +" Config { +let g:prettier#config#print_width = 80 +let g:prettier#config#tab_width = 2 +let g:prettier#config#use_tabs = 'true' +let g:prettier#config#semi = 'false' +let g:prettier#config#single_quote = 'true' +let g:prettier#config#bracket_spacing = 'true' +let g:prettier#config#jsx_bracket_same_line = 'false' +let g:prettier#config#arrow_parens = 'avoid' +let g:prettier#config#trailing_comma = 'es5' +" flow|babylon|typescript|css|less|scss|json|graphql|markdown or empty string +let g:prettier#config#parser = 'typescript' +" cli-override|file-override|prefer-file +let g:prettier#config#config_precedence = 'cli-override' +" always|never|preserve +let g:prettier#config#prose_wrap = 'preserve' +" css|strict|ignore +let g:prettier#config#html_whitespace_sensitivity = 'strict' +let g:prettier#config#require_pragma = 'true' +" lf|crlf|cr|all +let g:prettier#config#end_of_line = get(g:, 'prettier#config#end_of_line', 'all') +" } diff --git a/config/settings.vim b/config/settings.vim index 7ce4578..7abb7e7 100644 --- a/config/settings.vim +++ b/config/settings.vim @@ -1,16 +1,17 @@ -"# Basic Config # +" { Basic Config "syntax on -"set hlsearch set t_Co=256 if exists('+termguicolors') let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors - endif set nocompatible +filetype plugin indent on +filetype on + set updatetime=600 set nobackup set nowritebackup @@ -22,12 +23,11 @@ set autoindent set encoding=UTF-8 set history=50 -" Tabbing to 3 -"set list -"set listchars=tab:\│\ -set tabstop=3 -set shiftwidth=3 -set sw=3 +" Tabbing to +set list listchars=tab:│\ ,trail:·,precedes:←,extends:→ +set tabstop=2 +set shiftwidth=2 +"set sw=2 " Basics set nowrap @@ -42,14 +42,15 @@ set noerrorbells set novisualbell set t_vb= set tm=500 -set showcmd set tw=500 +set showcmd set ignorecase set smartcase " Reducing lag -set regexpengine=1 set lazyredraw -"set norelativenumber set ttyfast set foldmethod=manual +set re=2 + +" } diff --git a/ginit.vim b/ginit.vim index d1b58ea..d9f6f4e 100644 --- a/ginit.vim +++ b/ginit.vim @@ -4,7 +4,7 @@ set mouse=a " Set Editor Font if exists(':GuiFont') " Use GuiFont! to ignore font errors - GuiFont! Roboto Mono:h11:w63 + GuiFont! Roboto Mono:h13:w63 endif " Disable GUI Tabline @@ -26,5 +26,3 @@ endif nnoremap :call GuiShowContextMenu() inoremap :call GuiShowContextMenu() vnoremap :call GuiShowContextMenu()gv - -call GuiWindowMaximized(1) diff --git a/init.vim b/init.vim index 883cf80..4e3a6a5 100644 --- a/init.vim +++ b/init.vim @@ -1,68 +1,67 @@ " { Plugins call plug#begin('~\.vim\plugged') " LSP -Plug 'neovim/nvim-lspconfig' -Plug 'glepnir/lspsaga.nvim' -Plug 'nvim-lua/completion-nvim' -Plug 'aca/completion-tabnine', { 'do': './install.sh' } -Plug 'folke/trouble.nvim' -Plug 'folke/lsp-colors.nvim' -" CoC -Plug 'neoclide/coc.nvim', { -\ 'branch': 'release', -\ 'for': ['html', 'json', 'css', 'vim', 'lua'] -\ } +Plug 'neoclide/coc.nvim', {'branch': 'release'} "VS Code -Plug 'mhinz/vim-startify' +Plug 'szw/vim-maximizer' +Plug 'christoomey/vim-tmux-navigator' + Plug 'kyazdani42/nvim-tree.lua' -Plug 'ryanoasis/vim-devicons' -Plug 'kyazdani42/nvim-web-devicons' Plug 'akinsho/nvim-bufferline.lua' Plug 'hoob3rt/lualine.nvim' -Plug 'easymotion/vim-easymotion' + +Plug 'ryanoasis/vim-devicons' +Plug 'kyazdani42/nvim-web-devicons' + Plug 'scrooloose/nerdcommenter' Plug 'chrisbra/Colorizer' -" Windows navigate -Plug 'christoomey/vim-tmux-navigator' +Plug 'terryma/vim-multiple-cursors' + +Plug 'prettier/vim-prettier', { +\ 'do': 'yarn install', +\ 'branch': 'release/0.x' +\ } +" Git +Plug 'lewis6991/gitsigns.nvim' " Highlight Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' } Plug 'nvim-treesitter/playground' " Snippets +Plug 'easymotion/vim-easymotion' Plug 'mattn/emmet-vim' Plug 'tpope/vim-surround' -Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' " Debugger -Plug 'szw/vim-maximizer' Plug 'puremourning/vimspector' " Telescope Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' -" Git -Plug 'lewis6991/gitsigns.nvim' call plug#end() " } +" VSCode colorscheme let g:vscode_style = "dark" colorscheme vscode +" Sublime Text colorscheme +"syntax on +"colorscheme sublimemonokai +"let g:sublimemonokai_term_italic = 1 + " { Sources -" ./colors + +" .\colors\ "source $LOCALAPPDATA\nvim\colors\ui\statusline.vim "source $LOCALAPPDATA\nvim\colors\ui\tabline.vim -" ./mappings +" .\keys\ source $LOCALAPPDATA\nvim\keys\mappings.vim -" ./config +" .\config\ source $LOCALAPPDATA\nvim\config\settings.vim +source $LOCALAPPDATA\nvim\config\prettier.vim source $LOCALAPPDATA\nvim\config\autocommands.vim -source $LOCALAPPDATA\nvim\config\lsp-config.vim source $LOCALAPPDATA\nvim\config\plugs-config.vim +source $LOCALAPPDATA\nvim\config\coc-config.vim source $LOCALAPPDATA\nvim\config\bufferline.lua -source $LOCALAPPDATA\nvim\config\lualine.lua source $LOCALAPPDATA\nvim\config\luatree.vim -source $LOCALAPPDATA\nvim\config\coc-config.vim -" ./ +source $LOCALAPPDATA\nvim\config\lualine.lua " } - -" :help startify-faq-02 -set viminfo='100,n$HOME/.vim/files/info/viminfo diff --git a/keys/mappings.vim b/keys/mappings.vim index 8dfce99..8ebda90 100644 --- a/keys/mappings.vim +++ b/keys/mappings.vim @@ -24,15 +24,49 @@ inoremap kj " ys Add character " gS Add in visual mode +" Terminal +" Terminal Function +let g:term_buf = 0 +let g:term_win = 0 +function! TermToggle(height) + if win_gotoid(g:term_win) + hide + else + botright new + exec "resize " . a:height + try + exec "buffer " . g:term_buf + catch + call termopen("powershell.exe -NoLogo", {"detach": 0}) + let g:term_buf = bufnr("") + set nonumber + set norelativenumber + set signcolumn=no + endtry + startinsert! + let g:term_win = win_getid() + endif +endfunction + +nnoremap :call TermToggle(12) +inoremap :call TermToggle(12) +tnoremap :call TermToggle(12) +" Terminal go back to normal mode +tnoremap +tnoremap :q! :q! +" Terminal in other buffer +nnoremap T :term! powershell -NoLogo +" Float terminal + " TAB in general mode will move to text buffer nnoremap :bnext! " SHIFT-TAB will go back nnoremap :bprevious! -nmap :e %:h/ +nmap :e! %:h/ nmap :bdelete! " Alternate way to save -nnoremap :w +nnoremap :w! " Alternate way to quit nnoremap :xa! @@ -43,33 +77,31 @@ nnoremap " Move code blocks/identation xnoremap :move '<-2gv-gv xnoremap :move '>+1gv-gv -vnoremap >gv +vnoremap < >gv " Split nnoremap :vsplit nnoremap :split -" Terminal -nmap t :term powershell! - " Nerdtree comment nmap ++ NERDCommenterToggle +vmap ++ NERDCommenterToggle vmap -- NERDCommenterMinimal " Quick rename nnoremap :%s///gc$F/i -nnoremap m, :nohl +nnoremap :nohl " Maximazer -nmap m :MaximizerToggle! +nmap mm :MaximizerToggle! " VimInspector nmap :call vimspector#Launch() nmap fr :VimspectorReset nmap fe :VimspectorEval nmap fw :VimspectorWatch -"autocmd Filetype java nmap ff :CocCommand java.debug.vimspector.start +"autocmd Filetype java nmap :CocCommand java.debug.vimspector.start " Lua Completion inoremap pumvisible() ? "\" : "\" diff --git a/lua/vscode/init.lua b/lua/vscode/init.lua index fb8ddcf..8af8085 100644 --- a/lua/vscode/init.lua +++ b/lua/vscode/init.lua @@ -6,7 +6,6 @@ local utils = require("vscode.utils") local vscode = {} - vscode.set = function () utils.load() end @@ -18,6 +17,3 @@ vscode.change_style = function (style) end return vscode - - - diff --git a/newpreview.png b/newpreview.png deleted file mode 100644 index 5749267..0000000 Binary files a/newpreview.png and /dev/null differ diff --git a/preview.png b/preview.png deleted file mode 100644 index f1be3a5..0000000 Binary files a/preview.png and /dev/null differ