feat(config): switch (n)vim colorscheme to pencil

Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
This commit is contained in:
2025-03-25 15:27:07 +02:00
parent 38e340ac8d
commit e215fe0a2f
9 changed files with 677 additions and 123 deletions

View File

@@ -64,7 +64,7 @@ require('lazy').setup(
}
)
require('nvm-default').setup()
-- require('nvm-default').setup()
require 'keymaps'

View File

@@ -13,9 +13,9 @@ local a = vim.api -- A table to store API functions
g.mapleader = ' ' -- Space as the leader key
g.maplocalleader = ' ' -- Space as the local leader key
g.colors_theme = 'tokyonight' -- Set the colorscheme
g.colors_variant_light = 'tokyonight-day' -- Set the light variant
g.colors_variant_dark = 'tokyonight-storm' -- Set the dark variant
g.colors_theme = 'pencil' -- Set the colorscheme
-- g.colors_variant_light = 'tokyonight-day' -- Set the light variant
-- g.colors_variant_dark = 'tokyonight-storm' -- Set the dark variant
g.editorconfig = true -- Make sure editorconfig support is enabled
g.loaded_perl_provider = 0 -- Disable perl provider

View File

@@ -335,6 +335,7 @@ return {
sh = { 'shfmt' },
bash = { 'shfmt' },
php = { 'phpcbf' },
python = { 'isort', 'black' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--

View File

@@ -54,7 +54,7 @@ return {
event_handlers = {
{
event = 'file_opened',
handler = function(file_path)
handler = function(_)
require('neo-tree.command').execute { action = 'close' }
end,
},

View File

@@ -1,13 +1,12 @@
return {
-- Theme of choice, tokyonight
-- https://github.com/folke/tokyonight.nvim
-- https://github.com/preservim/vim-colors-pencil
{
'folke/tokyonight.nvim',
'preservim/vim-colors-pencil',
priority = 1000, -- Make sure to load this before all the other start plugins.
init = function() vim.cmd.colorscheme(vim.g.colors_theme) end,
opts = {
transparent = true,
},
config = function()
vim.cmd 'colorscheme pencil'
vim.api.nvim_set_option_value('pencil_terminal_italics', 1, {})
end,
},
-- Automatic dark mode
@@ -18,11 +17,11 @@ return {
update_interval = 1000,
set_dark_mode = function()
vim.api.nvim_set_option_value('background', 'dark', {})
vim.cmd.colorscheme(vim.g.colors_variant_dark)
-- vim.cmd.colorscheme(vim.g.colors_variant_dark)
end,
set_light_mode = function()
vim.api.nvim_set_option_value('background', 'light', {})
vim.cmd.colorscheme(vim.g.colors_variant_light)
-- vim.cmd.colorscheme(vim.g.colors_variant_light)
end,
},
},

View File

@@ -1,84 +0,0 @@
let mapleader=' ' " Map leader to <space>
filetype off " disable filetype detection (but re-enable later, see below)
" find matching tags in html/xml documents using matchit
filetype plugin on
packadd! matchit
" disable super buggy netrw
let g:loaded_netrw=1
let g:netrw_loaded_netrwPlugin=1
" show JSDoc highlight colors
let g:javascript_plugin_jsdoc=1
set backspace=indent,eol,start " Backspace behavior
set cindent " Use 'C' style program indenting
set cursorline " Highlight current line
set encoding=utf-8 " UTF-8
set expandtab " Use spaces instead of tabs
set fileformats=unix,dos,mac " File formats
set foldmethod=indent " Fold based on indent
set foldlevel=99 " Open all folds
set guioptions=egmrti " GUI options
set hidden " Enable hidden buffers
set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally
set laststatus=2 " Always show statusline (even with only single window)
set linespace=3 " Set line spacing
set list " Show invisible characters
set listchars=tab:⌴\ ,trail:◼,nbsp:•,extends:…,precedes:… " Invisible characters
set modeline " Enable modelines
set modelines=3 " Number of lines to check for modelines
set mouse=a " Enable mouse support
set mousemodel=popup " Enable mouse support
set nobackup " Disable backup files
set nocompatible " disable compatibility mode with vi
set nowritebackup " Disable backup files
set number " Show line numbers
set relativenumber " Show relative line numbers
set ruler " Show row and column ruler information
set scrolloff=8 " Minimum number of lines to keep above and below the cursor
set shiftwidth=4 " Number of auto-indent spaces
set shortmess+=A " Don't show autocommand messages
set shortmess+=F " Avoid showing the "file-info" message
set shortmess+=I " Don't show intro message
set shortmess+=O " Avoid showing the "file-read" message
set shortmess+=O " Don't show overlength messages
set shortmess+=T " Don't show title messages
set shortmess+=W " Don't show "written" messages
set shortmess+=a " Avoid showing the "ATTENTION" message
set shortmess+=c " Avoid showing the "ins-completion-menu" message
set shortmess+=c " Don't pass messages to |ins-completion-menu|
set shortmess+=o " Avoid showing the "overlength" message
set shortmess+=t " Avoid showing the "trailing whitespace" message
set showcmd " Show command in status line
set showmatch " Highlight matching brace
set signcolumn=yes " Show sign column
set smartcase " Enable smart-case search
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=4 " Number of spaces per Tab
set spelllang=fi,en " Set the spell language
set spellsuggest=double " Suggest the first word when spell checking
set t_Co=256 " 256 colors
set termguicolors " Enable 24-bit RGB color in the terminal
set timeoutlen=500 " By default timeoutlen=1000 (ms)
set ttimeoutlen=0 " By default ttimeoutlen=-1 (ms)
set undolevels=1000 " Number of undo levels
set visualbell " Use visual bell (no beeping)
set wildmenu " Enable wildmenu
set wildmode=longest,list:longest " Command-line completion mode
set wrap " Wrap lines
set wrapscan " Searches wrap around the end of the file
" Ignore these files in wildmenu
set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__,vendor
colorscheme iceberg " Set the color scheme
filetype plugin indent on " enable filetype detection, plugins and indenting
" Set the shell
if exists('$SHELL')
set shell=$SHELL
else
set shell=/bin/sh
endif

View File

@@ -0,0 +1,175 @@
let g:airline#themes#pencil#palette = {}
function! airline#themes#pencil#refresh()
""""""""""""""""""""""""""""""""""""""""""""""""
" Options
""""""""""""""""""""""""""""""""""""""""""""""""
let s:background = get(g:, 'airline_pencil_bg', &background)
let s:ansi_colors = &t_Co < 16 ? 1 : 0
let s:tty = &t_Co == 8
""""""""""""""""""""""""""""""""""""""""""""""""
" Colors
""""""""""""""""""""""""""""""""""""""""""""""""
" Base colors
let s:base03 = {'t': s:ansi_colors ? 8 : (s:tty ? '0' : 234), 'g': '#212121'}
let s:base02 = {'t': s:ansi_colors ? '0' : (s:tty ? '0' : 235), 'g': '#424242'}
let s:base01 = {'t': s:ansi_colors ? 10 : (s:tty ? '0' : 240), 'g': '#909090'}
let s:base00 = {'t': s:ansi_colors ? 11 : (s:tty ? '7' : 241), 'g': '#545454'}
let s:base0 = {'t': s:ansi_colors ? 12 : (s:tty ? '7' : 244), 'g': '#B2B2B2'}
let s:base1 = {'t': s:ansi_colors ? 14 : (s:tty ? '7' : 245), 'g': '#636363'}
let s:base2 = {'t': s:ansi_colors ? 7 : (s:tty ? '7' : 254), 'g': '#D9D9D9'}
let s:base3 = {'t': s:ansi_colors ? 15 : (s:tty ? '7' : 7 ), 'g': '#C6C6C6'}
let s:darkblue= {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 24 ), 'g': '#005F87'}
let s:orange = {'t': s:ansi_colors ? 9 : (s:tty ? '1' : 166), 'g': '#D75F5F'}
let s:red = {'t': s:ansi_colors ? 1 : (s:tty ? '1' : 160), 'g': '#C30771'}
let s:magenta = {'t': s:ansi_colors ? 5 : (s:tty ? '5' : 125), 'g': '#E32791'}
let s:violet = {'t': s:ansi_colors ? 13 : (s:tty ? '5' : 61 ), 'g': '#6855DE'}
let s:blue = {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 33 ), 'g': '#008EC4'}
let s:cyan = {'t': s:ansi_colors ? 6 : (s:tty ? '6' : 37 ), 'g': '#20A5BA'}
let s:green = {'t': s:ansi_colors ? 2 : (s:tty ? '2' : 64 ), 'g': '#10A778'}
""""""""""""""""""""""""""""""""""""""""""""""""
" Simple mappings
" NOTE: These are easily tweakable mappings. The actual mappings get
" the specific gui and terminal colors from the base color dicts.
""""""""""""""""""""""""""""""""""""""""""""""""
" Normal mode
if s:background == 'dark'
let s:N1 = [s:base3, s:base1, 'bold']
let s:N2 = [s:base2, (s:tty ? s:base01 : s:base00), '']
let s:N3 = [s:base01, s:base02, '']
else
let s:N1 = [s:base2, s:base00, 'bold']
let s:N2 = [(s:tty ? s:base01 : s:base2), s:base1, '']
let s:N3 = [s:base1, s:base2, '']
endif
let s:NF = [s:orange, s:N3[1], '']
let s:NW = [s:base3, s:orange, '']
if s:background == 'dark'
let s:NM = [s:base1, s:N3[1], '']
let s:NMi = [s:base2, s:N3[1], '']
else
let s:NM = [s:base01, s:N3[1], '']
let s:NMi = [s:base02, s:N3[1], '']
endif
" Insert mode
let s:I1 = [s:N1[0], s:darkblue, 'bold']
let s:I2 = s:N2
let s:I3 = s:N3
let s:IF = s:NF
let s:IM = s:NM
" Visual mode
let s:V1 = [s:N1[0], s:magenta, 'bold']
let s:V2 = s:N2
let s:V3 = s:N3
let s:VF = s:NF
let s:VM = s:NM
" Replace mode
let s:R1 = [s:N1[0], s:red, '']
let s:R2 = s:N2
let s:R3 = s:N3
let s:RM = s:NM
let s:RF = s:NF
" Inactive, according to VertSplit in pencil
" (bg dark: base00; bg light: base0)
if s:background == 'dark'
let s:IA = [s:base01, s:base02, '']
else
let s:IA = [s:base1, s:base2, '']
endif
""""""""""""""""""""""""""""""""""""""""""""""""
" Actual mappings
" WARNING: Don't modify this section unless necessary.
""""""""""""""""""""""""""""""""""""""""""""""""
let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]]
let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]]
let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]]
let s:RFa = [s:RF[0].g, s:RF[1].g, s:RF[0].t, s:RF[1].t, s:RF[2]]
let g:airline#themes#pencil#palette.accents = {
\ 'red': s:NFa,
\ }
let g:airline#themes#pencil#palette.inactive = airline#themes#generate_color_map(
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]])
let g:airline#themes#pencil#palette.inactive_modified = {
\ 'airline_c': [s:NMi[0].g, '', s:NMi[0].t, '', s:NMi[2]]}
let g:airline#themes#pencil#palette.normal = airline#themes#generate_color_map(
\ [s:N1[0].g, s:N1[1].g, s:N1[0].t, s:N1[1].t, s:N1[2]],
\ [s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]],
\ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]])
let g:airline#themes#pencil#palette.normal.airline_warning = [
\ s:NW[0].g, s:NW[1].g, s:NW[0].t, s:NW[1].t, s:NW[2]]
let g:airline#themes#pencil#palette.normal_modified = {
\ 'airline_c': [s:NM[0].g, s:NM[1].g,
\ s:NM[0].t, s:NM[1].t, s:NM[2]]}
let g:airline#themes#pencil#palette.normal_modified.airline_warning =
\ g:airline#themes#pencil#palette.normal.airline_warning
let g:airline#themes#pencil#palette.insert = airline#themes#generate_color_map(
\ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]],
\ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]],
\ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]])
let g:airline#themes#pencil#palette.insert.airline_warning =
\ g:airline#themes#pencil#palette.normal.airline_warning
let g:airline#themes#pencil#palette.insert_modified = {
\ 'airline_c': [s:IM[0].g, s:IM[1].g,
\ s:IM[0].t, s:IM[1].t, s:IM[2]]}
let g:airline#themes#pencil#palette.insert_modified.airline_warning =
\ g:airline#themes#pencil#palette.normal.airline_warning
let g:airline#themes#pencil#palette.visual = airline#themes#generate_color_map(
\ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]],
\ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]],
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]])
let g:airline#themes#pencil#palette.visual.airline_warning =
\ g:airline#themes#pencil#palette.normal.airline_warning
let g:airline#themes#pencil#palette.visual_modified = {
\ 'airline_c': [s:VM[0].g, s:VM[1].g,
\ s:VM[0].t, s:VM[1].t, s:VM[2]]}
let g:airline#themes#pencil#palette.visual_modified.airline_warning =
\ g:airline#themes#pencil#palette.normal.airline_warning
let g:airline#themes#pencil#palette.replace = airline#themes#generate_color_map(
\ [s:R1[0].g, s:R1[1].g, s:R1[0].t, s:R1[1].t, s:R1[2]],
\ [s:R2[0].g, s:R2[1].g, s:R2[0].t, s:R2[1].t, s:R2[2]],
\ [s:R3[0].g, s:R3[1].g, s:R3[0].t, s:R3[1].t, s:R3[2]])
let g:airline#themes#pencil#palette.replace.airline_warning =
\ g:airline#themes#pencil#palette.normal.airline_warning
let g:airline#themes#pencil#palette.replace_modified = {
\ 'airline_c': [s:RM[0].g, s:RM[1].g,
\ s:RM[0].t, s:RM[1].t, s:RM[2]]}
let g:airline#themes#pencil#palette.replace_modified.airline_warning =
\ g:airline#themes#pencil#palette.normal.airline_warning
let g:airline#themes#pencil#palette.tabline = {}
let g:airline#themes#pencil#palette.tabline.airline_tab = [
\ s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]]
let g:airline#themes#pencil#palette.tabline.airline_tabtype = [
\ s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]]
endfunction
call airline#themes#pencil#refresh()

View File

@@ -0,0 +1,383 @@
" Vim Color File
" Name: pencil.vim
" Version: 0.6
" Maintainer: github.com/preservim
" License: The MIT License (MIT)
" Original iA Writer colors, to use as a guide
" White #F1F1F1
" OffWhiteIPad #F5F2EC
" OffWhiteDemo #F9F8F4
" Cursor #20BBFC
" Selection #B6D6FD
" SelectionNOS #D4D4D4
" StatusBar #EDEDED
" StatusBarBorder #D9D9D9 used for search too
" Text #424242
" Blue #B5D6FD
" Green #30C798
" Blue2 #1DAEE4
" gray #999999
" Red #E32791
" UnfocusedText #B8B8B8
" MenuSelected #2C81FB
" MenuUnSelected #545454
" MenuText #F1F1F1
" LightKeyBg #4B4B4B
" DarkKeyBg #262626
" NearBlack #181818
" SyntaxButton #363738
" SearchHighlight #F3E430 yellow
hi clear
if exists('syntax on')
syntax reset
endif
let g:colors_name='pencil'
if ! exists("g:pencil_higher_contrast_ui")
let g:pencil_higher_contrast_ui = 0
endif
if ! exists("g:pencil_neutral_code_bg")
let g:pencil_neutral_code_bg = 0
endif
if ! exists("g:pencil_neutral_headings")
let g:pencil_neutral_headings = 0
endif
" not all terminals support italics properly. If yours does, opt-in.
if ! exists("g:pencil_terminal_italics")
let g:pencil_terminal_italics = 0
endif
if ! exists("g:pencil_spell_undercurl")
let g:pencil_spell_undercurl = 1
endif
if ! exists("g:pencil_gutter_color")
let g:pencil_gutter_color = 0
endif
" Colors
let s:black = { "gui": "#212121", "cterm": "0" }
let s:medium_gray = { "gui": "#767676", "cterm": "243" }
let s:white = { "gui": "#F1F1F1", "cterm": "15" }
let s:actual_white = { "gui": "#FFFFFF", "cterm": "231" }
let s:light_black = { "gui": "#424242", "cterm": "8" }
let s:lighter_black = { "gui": "#545454", "cterm": "240" }
if g:pencil_higher_contrast_ui == 0
" darker shadow and whiter grays
let s:subtle_black = { "gui": "#262626", "cterm": "235" }
let s:light_gray = { "gui": "#D9D9D9", "cterm": "253" }
let s:lighter_gray = { "gui": "#E5E6E6", "cterm": "254" }
else
" lighter shadows and darker grays
let s:subtle_black = { "gui": "#303030", "cterm": "236" }
let s:light_gray = { "gui": "#B2B2B2", "cterm": "249" }
let s:lighter_gray = { "gui": "#C6C6C6", "cterm": "251" }
endif
let s:pink = { "gui": "#fb007a", "cterm": "9" }
let s:dark_red = { "gui": "#C30771", "cterm": "1" }
let s:light_red = { "gui": "#E32791", "cterm": "1" }
let s:orange = { "gui": "#D75F5F", "cterm": "167" }
let s:darker_blue = { "gui": "#005F87", "cterm": "18" }
let s:dark_blue = { "gui": "#008EC4", "cterm": "4" }
let s:blue = { "gui": "#20BBFC", "cterm": "12" }
let s:light_blue = { "gui": "#b6d6fd", "cterm": "153" }
let s:dark_cyan = { "gui": "#20A5BA", "cterm": "6" }
let s:light_cyan = { "gui": "#4FB8CC", "cterm": "14" }
let s:dark_green = { "gui": "#10A778", "cterm": "2" }
let s:light_green = { "gui": "#5FD7A7", "cterm": "10" }
let s:dark_purple = { "gui": "#523C79", "cterm": "5" }
let s:light_purple = { "gui": "#6855DE", "cterm": "13" }
let s:yellow = { "gui": "#F3E430", "cterm": "11" }
let s:dark_yellow = { "gui": "#A89C14", "cterm": "3" }
if &background == "dark"
let s:bg = s:black
let s:bg_subtle = s:light_black
let s:bg_very_subtle = s:subtle_black
let s:norm = s:lighter_gray
let s:norm_subtle = s:light_gray
let s:purple = s:light_purple
let s:cyan = s:light_cyan
let s:green = s:light_green
let s:red = s:light_red
let s:visual = s:lighter_black
else
let s:bg = s:white
let s:bg_subtle = s:light_gray
let s:bg_very_subtle = s:lighter_gray
let s:norm = s:light_black
let s:norm_subtle = s:lighter_black
let s:purple = s:dark_purple
let s:cyan = s:dark_cyan
let s:green = s:dark_green
let s:red = s:dark_red
let s:visual = s:light_blue
endif
if g:pencil_neutral_headings == 1
let s:head_a = s:norm
let s:head_b = s:norm
let s:head_c = s:norm
else
let s:head_a = s:dark_blue
let s:head_b = s:blue
let s:head_c = s:dark_cyan
endif
if g:pencil_neutral_code_bg == 1
let s:code_bg = s:bg
else
let s:code_bg = s:bg_very_subtle
endif
if g:pencil_spell_undercurl == 1
let s:sp_un = 'undercurl'
else
let s:sp_un = 'underline'
endif
" shamelessly stolen from hemisu: https://github.com/noahfrederick/vim-hemisu/
function! s:h(group, style)
" Not all terminals support italics properly. If yours does, opt-in.
if g:pencil_terminal_italics == 0 && has_key(a:style, "cterm") && a:style["cterm"] == "italic"
unlet a:style.cterm
endif
execute "highlight" a:group
\ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE")
\ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE")
\ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE")
\ "gui=" (has_key(a:style, "gui") ? a:style.gui : "NONE")
\ "ctermfg=" (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE")
\ "ctermbg=" (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE")
\ "cterm=" (has_key(a:style, "cterm") ? a:style.cterm : "NONE")
endfunction
" common groups ================================================================
" (see `:h w18`)
call s:h("Normal", {"bg": s:bg, "fg": s:norm})
call s:h("Cursor", {"bg": s:blue, "fg": s:norm })
call s:h("Comment", {"fg": s:medium_gray, "gui": "italic", "cterm": "italic"})
call s:h("Constant", {"fg": s:cyan})
hi! link String Constant
hi! link Character Constant
hi! link Number Constant
hi! link Boolean Constant
hi! link Float Constant
call s:h("Identifier", {"fg": s:dark_blue})
hi! link Function Identifier
call s:h("Statement", {"fg": s:green})
hi! link Conditonal Statement
hi! link Repeat Statement
hi! link Label Statement
hi! link Operator Statement
hi! link Keyword Statement
hi! link Exception Statement
call s:h("PreProc", {"fg": s:red})
hi! link Include PreProc
hi! link Define PreProc
hi! link Macro PreProc
hi! link PreCondit PreProc
call s:h("Type", {"fg": s:purple})
hi! link StorageClass Type
hi! link Structure Type
hi! link Typedef Type
call s:h("Special", {"fg": s:pink})
hi! link SpecialChar Special
hi! link Tag Special
hi! link Delimiter Special
hi! link SpecialComment Special
hi! link Debug Special
call s:h("Underlined", {"fg": s:norm , "gui": "underline", "cterm": "underline"})
call s:h("Ignore", {"fg": s:bg })
call s:h("Error", {"fg": s:actual_white, "bg": s:red , "gui": "bold" , "cterm": "bold" })
call s:h("Todo", {"fg": s:actual_white, "bg": s:pink, "gui": "bold" , "cterm": "bold" })
" ui chrome ====================================================================
" ordered according to `:help hitest.vim`
call s:h("SpecialKey", {"fg": s:light_green})
call s:h("NonText", {"fg": s:bg_subtle})
call s:h("Directory", {"fg": s:dark_blue})
call s:h("ErrorMsg", {"fg": s:pink})
call s:h("IncSearch", {"bg": s:yellow, "fg": s:light_black})
call s:h("Search", {"bg": s:bg_subtle})
call s:h("MoreMsg", {"fg": s:medium_gray, "gui": "bold", "cterm": "bold"})
hi! link ModeMsg MoreMsg
call s:h("LineNr", {"fg": s:bg_subtle})
call s:h("CursorLineNr", {"fg": s:blue, "bg": s:bg_very_subtle})
call s:h("Question", {"fg": s:red})
call s:h("StatusLine", {"bg": s:bg_very_subtle})
call s:h("Conceal", {"fg": s:norm})
call s:h("StatusLineNC", {"bg": s:bg_very_subtle, "fg": s:medium_gray})
call s:h("VertSplit", {"bg": s:bg_very_subtle, "fg": s:bg_very_subtle})
call s:h("Title", {"fg": s:dark_blue})
call s:h("Visual", {"bg": s:visual})
call s:h("VisualNOS", {"bg": s:bg_subtle})
call s:h("WarningMsg", {"fg": s:red})
call s:h("WildMenu", {"fg": s:bg, "bg": s:norm})
call s:h("Folded", {"fg": s:medium_gray})
call s:h("FoldColumn", {"fg": s:bg_subtle})
call s:h("DiffAdd", {"bg": s:bg_subtle, "fg": s:green})
call s:h("DiffAdded", {"bg": s:bg_subtle, "fg": s:green})
call s:h("DiffDelete", {"bg": s:bg_subtle, "fg": s:red})
call s:h("DiffRemoved", {"bg": s:bg_subtle, "fg": s:red})
call s:h("DiffChange", {"bg": s:bg_subtle, "fg": s:dark_yellow})
call s:h("DiffChanged", {"bg": s:bg_subtle, "fg": s:dark_yellow})
call s:h("DiffText", {"bg": s:bg_subtle, "fg": s:dark_blue})
call s:h("SignColumn", {"fg": s:light_green})
call s:h("SpellBad", {"gui": s:sp_un, "sp": s:red, "cterm": s:sp_un, "fg": s:red})
call s:h("SpellCap", {"gui": s:sp_un, "sp": s:light_green, "cterm": s:sp_un, "fg": s:light_green})
call s:h("SpellRare", {"gui": s:sp_un, "sp": s:pink, "cterm": s:sp_un, "fg": s:pink})
call s:h("SpellLocal", {"gui": s:sp_un, "sp": s:dark_green, "cterm": s:sp_un, "fg": s:dark_green})
call s:h("Pmenu", {"fg": s:norm, "bg": s:bg_subtle})
call s:h("PmenuSel", {"fg": s:norm, "bg": s:blue})
call s:h("PmenuSbar", {"fg": s:norm, "bg": s:bg_subtle})
call s:h("PmenuThumb", {"fg": s:norm, "bg": s:bg_subtle})
call s:h("TabLine", {"fg": s:norm, "bg": s:bg_very_subtle})
call s:h("TabLineSel", {"fg": s:blue, "bg": s:bg_subtle, "gui": "bold", "cterm": "bold"})
call s:h("TabLineFill", {"fg": s:norm, "bg": s:bg_very_subtle})
call s:h("CursorColumn", {"bg": s:bg_very_subtle})
call s:h("CursorLine", {"bg": s:bg_very_subtle})
call s:h("ColorColumn", {"bg": s:bg_subtle})
" remainder of syntax highlighting
call s:h("MatchParen", {"bg": s:bg_subtle, "fg": s:norm})
call s:h("qfLineNr", {"fg": s:medium_gray})
" hi helpHyperTextJump guifg=#5FAFD7 ctermfg=74
" HTML syntax
hi! link htmlTag Special
hi! link htmlEndTag htmlTag
hi! link htmlTagName KeyWord
" html5 tags show up as htmlTagN
hi! link htmlTagN Keyword
" HTML content
call s:h("htmlH1", {"fg": s:head_a, "gui": "bold,italic", "cterm": "bold" })
call s:h("htmlH2", {"fg": s:head_a, "gui": "bold" , "cterm": "bold" })
call s:h("htmlH3", {"fg": s:head_b, "gui": "italic" , "cterm": "italic" })
call s:h("htmlH4", {"fg": s:head_b, "gui": "italic" , "cterm": "italic" })
call s:h("htmlH5", {"fg": s:head_c })
call s:h("htmlH6", {"fg": s:head_c })
call s:h("htmlLink", {"fg": s:blue , "gui": "underline" , "cterm": "underline"})
call s:h("htmlItalic", { "gui": "italic" , "cterm": "italic" })
call s:h("htmlBold", { "gui": "bold" , "cterm": "bold" })
call s:h("htmlBoldItalic",{ "gui": "bold,italic", "cterm": "bold" })
" hi htmlString guifg=#87875f guibg=NONE gui=NONE ctermfg=101 ctermbg=NONE cterm=NONE
" tpope/vim-markdown
call s:h("markdownBlockquote", {"fg": s:norm})
call s:h("markdownBold", {"fg": s:norm , "gui": "bold" , "cterm": "bold" })
call s:h("markdownBoldItalic", {"fg": s:norm , "gui": "bold,italic", "cterm": "bold" })
call s:h("markdownEscape", {"fg": s:norm})
call s:h("markdownH1", {"fg": s:head_a, "gui": "bold,italic", "cterm": "bold" })
call s:h("markdownH2", {"fg": s:head_a, "gui": "bold" , "cterm": "bold" })
call s:h("markdownH3", {"fg": s:head_a, "gui": "italic" , "cterm": "italic"})
call s:h("markdownH4", {"fg": s:head_a, "gui": "italic" , "cterm": "italic"})
call s:h("markdownH5", {"fg": s:head_a})
call s:h("markdownH6", {"fg": s:head_a})
call s:h("markdownHeadingDelimiter", {"fg": s:norm})
call s:h("markdownHeadingRule", {"fg": s:norm})
call s:h("markdownId", {"fg": s:medium_gray})
call s:h("markdownIdDeclaration", {"fg": s:norm_subtle})
call s:h("markdownItalic", {"fg": s:norm , "gui": "italic" , "cterm": "italic"})
call s:h("markdownLinkDelimiter", {"fg": s:medium_gray})
call s:h("markdownLinkText", {"fg": s:norm})
call s:h("markdownLinkTextDelimiter", {"fg": s:medium_gray})
call s:h("markdownListMarker", {"fg": s:norm})
call s:h("markdownOrderedListMarker", {"fg": s:norm})
call s:h("markdownRule", {"fg": s:norm})
call s:h("markdownUrl", {"fg": s:medium_gray, "gui": "underline", "cterm": "underline"})
call s:h("markdownUrlDelimiter", {"fg": s:medium_gray})
call s:h("markdownUrlTitle", {"fg": s:norm})
call s:h("markdownUrlTitleDelimiter", {"fg": s:medium_gray})
call s:h("markdownCode", {"fg": s:norm, "bg": s:code_bg})
call s:h("markdownCodeDelimiter", {"fg": s:norm, "bg": s:code_bg})
" plasticboy/vim-markdown
call s:h("mkdBlockquote", {"fg": s:norm})
call s:h("mkdDelimiter", {"fg": s:medium_gray})
call s:h("mkdID", {"fg": s:medium_gray})
call s:h("mkdLink", {"fg": s:norm})
call s:h("mkdLinkDef", {"fg": s:medium_gray})
call s:h("mkdListItem", {"fg": s:norm})
call s:h("mkdNonListItemBlock", {"fg": s:norm}) " bug in syntax?
call s:h("mkdRule", {"fg": s:norm})
call s:h("mkdURL", {"fg": s:medium_gray, "gui": "underline", "cterm": "underline"})
call s:h("mkdCode", {"fg": s:norm, "bg": s:code_bg})
" gabrielelana/vim-markdown
call s:h("markdownBlockquoteDelimiter", {"fg": s:norm})
call s:h("markdownInlineDelimiter", {"fg": s:norm})
call s:h("markdownItemDelimiter", {"fg": s:norm})
call s:h("markdownLinkReference", {"fg": s:medium_gray})
call s:h("markdownLinkText", {"fg": s:norm})
call s:h("markdownLinkTextContainer", {"fg": s:medium_gray})
call s:h("markdownLinkUrl", {"fg": s:medium_gray, "gui": "underline", "cterm": "underline"})
call s:h("markdownLinkUrlContainer", {"fg": s:medium_gray})
call s:h("markdownFencedCodeBlock", {"fg": s:norm, "bg": s:code_bg})
call s:h("markdownInlineCode", {"fg": s:norm, "bg": s:code_bg})
" mattly/vim-markdown-enhancements
call s:h("mmdFootnoteDelimiter", {"fg": s:medium_gray})
call s:h("mmdFootnoteMarker", {"fg": s:norm})
call s:h("mmdTableAlign", {"fg": s:norm})
call s:h("mmdTableDelimiter", {"fg": s:norm})
call s:h("mmdTableHeadDelimiter", {"fg": s:norm})
call s:h("mmdTableHeader", {"fg": s:norm})
call s:h("mmdTableCaptionDelimiter", {"fg": s:norm})
call s:h("mmdTableCaption", {"fg": s:norm})
" Textile content
" https://github.com/timcharper/textile.vim/blob/master/syntax/textile.vim
"call s:h("txtBold", {"fg": s:norm , "gui": "bold" , "cterm": "bold" })
"call s:h("txtEmphasis", {"fg": s:norm , "gui": "italic" , "cterm": "italic"})
" XML content
hi! link xmlTag htmlTag
hi! link xmlEndTag xmlTag
hi! link xmlTagName htmlTagName
" Signify, git-gutter
if g:pencil_gutter_color == 1
hi link SignifySignAdd DiffAdd
hi link SignifySignDelete DiffDelete
hi link SignifySignChange DiffChange
hi link GitGutterAdd DiffAdd
hi link GitGutterDelete DiffDelete
hi link GitGutterChange DiffChange
hi link GitGutterChangeDelete DiffChange
else
hi link SignifySignAdd LineNr
hi link SignifySignDelete LineNr
hi link SignifySignChange LineNr
hi link GitGutterAdd LineNr
hi link GitGutterDelete LineNr
hi link GitGutterChange LineNr
hi link GitGutterChangeDelete LineNr
endif

View File

@@ -15,9 +15,13 @@ endif
let g:vim_bootstrap_langs = "go,html,javascript,lua,php,python,typescript"
let g:vim_bootstrap_editor = "vim" " nvim or vim
let g:vim_bootstrap_theme = "iceberg"
let g:vim_bootstrap_theme = "pencil"
let g:vim_bootstrap_frams = "vuejs"
" ale
let g:ale_fixers = {}
let g:ale_linters = { "python": [ "flake8" ] }
if !filereadable(vimplug_exists)
if !executable(curl_exists)
echoerr "You have to install curl or first install vim-plug yourself!"
@@ -68,9 +72,6 @@ call plug#begin(expand('$HOME/.config/vim/plugged'))
" vim-airline
Plug 'vim-airline/vim-airline'
" iceberg.vim - Iceberg color scheme
Plug 'cocopon/iceberg.vim'
" fzf.vim - Fuzzy finder
if isdirectory('~/.config/vim/extra/fzf')
Plug '~/.config/vim/extra/fzf' | Plug 'junegunn/fzf.vim'
@@ -132,6 +133,92 @@ call plug#begin(expand('$HOME/.config/vim/plugged'))
call plug#end()
" }}}
let mapleader=' ' " Map leader to <space>
filetype off " disable filetype detection (but re-enable later, see below)
" find matching tags in html/xml documents using matchit
filetype plugin on
packadd! matchit
" disable super buggy netrw
let g:loaded_netrw=1
let g:netrw_loaded_netrwPlugin=1
" show JSDoc highlight colors
let g:javascript_plugin_jsdoc=1
set backspace=indent,eol,start " Backspace behavior
set cindent " Use 'C' style program indenting
set cursorline " Highlight current line
set encoding=utf-8 " UTF-8
set expandtab " Use spaces instead of tabs
set fileformats=unix,dos,mac " File formats
set foldmethod=indent " Fold based on indent
set foldlevel=99 " Open all folds
set guioptions=egmrti " GUI options
set hidden " Enable hidden buffers
set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally
set laststatus=2 " Always show statusline (even with only single window)
set linespace=3 " Set line spacing
set list " Show invisible characters
set listchars=tab:⌴\ ,trail:◼,nbsp:•,extends:…,precedes:… " Invisible characters
set modeline " Enable modelines
set modelines=3 " Number of lines to check for modelines
set mouse=a " Enable mouse support
set mousemodel=popup " Enable mouse support
set nobackup " Disable backup files
set nocompatible " disable compatibility mode with vi
set nowritebackup " Disable backup files
set number " Show line numbers
set relativenumber " Show relative line numbers
set ruler " Show row and column ruler information
set scrolloff=8 " Minimum number of lines to keep above and below the cursor
set shiftwidth=4 " Number of auto-indent spaces
set shortmess+=A " Don't show autocommand messages
set shortmess+=F " Avoid showing the "file-info" message
set shortmess+=I " Don't show intro message
set shortmess+=O " Avoid showing the "file-read" message
set shortmess+=O " Don't show overlength messages
set shortmess+=T " Don't show title messages
set shortmess+=W " Don't show "written" messages
set shortmess+=a " Avoid showing the "ATTENTION" message
set shortmess+=c " Avoid showing the "ins-completion-menu" message
set shortmess+=c " Don't pass messages to |ins-completion-menu|
set shortmess+=o " Avoid showing the "overlength" message
set shortmess+=t " Avoid showing the "trailing whitespace" message
set showcmd " Show command in status line
set showmatch " Highlight matching brace
set signcolumn=yes " Show sign column
set smartcase " Enable smart-case search
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=4 " Number of spaces per Tab
set spelllang=fi,en " Set the spell language
set spellsuggest=double " Suggest the first word when spell checking
set t_Co=256 " 256 colors
set termguicolors " Enable 24-bit RGB color in the terminal
set timeoutlen=500 " By default timeoutlen=1000 (ms)
set ttimeoutlen=0 " By default ttimeoutlen=-1 (ms)
set undolevels=1000 " Number of undo levels
set visualbell " Use visual bell (no beeping)
set wildmenu " Enable wildmenu
set wildmode=longest,list:longest " Command-line completion mode
set wrap " Wrap lines
set wrapscan " Searches wrap around the end of the file
" Ignore these files in wildmenu
set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__,vendor
colorscheme pencil " Set the color scheme
filetype plugin indent on " enable filetype detection, plugins and indenting
" Set the shell
if exists('$SHELL')
set shell=$SHELL
else
set shell=/bin/sh
endif
" COC
let g:coc_global_extensions = [
\ '@yaegassy/coc-intelephense',
@@ -160,9 +247,6 @@ let g:session_command_aliases = 1
syntax on
" set statusline to show the file name
" set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L)|
" Search mappings: These will make it so that going to the next one in a
" search will center on the line it's found in.
nnoremap n nzzzv
@@ -180,14 +264,14 @@ let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tagbar#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_skip_empty_sections = 1
let g:airline_theme = 'iceberg'
let g:airline_theme = 'pencil'
" NERDTree configuration
let g:NERDTreeChDirMode=2
let g:NERDTreeIgnore=['node_modules', 'vendor', '\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__']
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$']
let g:NERDTreeShowBookmarks=1
let g:nerdtree_tabs_focus_on_files=1
let g:NERDTreeIgnore = [ 'node_modules', 'vendor', '\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__' ]
let g:NERDTreeSortOrder = [ '^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$' ]
let g:NERDTreeShowBookmarks = 1
let g:nerdtree_tabs_focus_on_files = 1
let g:NERDTreeMapOpenInTabSilent = '<RightMouse>'
let g:NERDTreeWinSize = 50
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite,*node_modules/,*vendor/
@@ -267,14 +351,14 @@ xmap <leader>c <Plug>(coc-codeaction-selected)
let g:wordy#ring = [
\ 'weak',
\ ['being', 'passive-voice', ],
\ [ 'being', 'passive-voice', ],
\ 'business-jargon',
\ 'weasel',
\ 'puffery',
\ ['problematic', 'redundant', ],
\ ['colloquial', 'idiomatic', 'similies', ],
\ [ 'problematic', 'redundant', ],
\ [ 'colloquial', 'idiomatic', 'similies', ],
\ 'art-jargon',
\ ['contractions', 'opinion', 'vague-time', 'said-synonyms', ],
\ [ 'contractions', 'opinion', 'vague-time', 'said-synonyms', ],
\ 'adjectives',
\ 'adverbs',
\ ]
@@ -303,13 +387,6 @@ endif
"" Custom configs
"*****************************************************************************
" ale
let g:ale_linters = {
\ "vim": [ "vint" ]
\}
let g:ale_fixers = {
\}
" javascript
let g:javascript_enable_domhtmlcss = 1
@@ -339,11 +416,14 @@ let g:jedi#smart_auto_mappings = 0
" ale
:call extend(g:ale_linters, {
\ 'python': [ 'flake8' ],
\ 'python': [ 'black' ],
\ })
:call extend(g:ale_fixers, {
\ '*': ['remove_trailing_lines', 'trim_whitespace']
\ '*': [ 'remove_trailing_lines', 'trim_whitespace' ],
\ 'python': [ 'autopep8', 'isort' ],
\ })
let g:ale_sign_column_always = 1
let g:ale_fix_on_save = 1