Building hackertheme

Building hackertheme

Where colorschemes live

Neovim looks for colorschemes in every colors/ directory on its runtime path. For your own theme, that means:

~/.config/nvim/colors/hackertheme.vim

The file name becomes the theme name: hackertheme.vim is what :colorscheme hackertheme loads.

The complete theme

" hackertheme - a dark hacker colorscheme

set background=dark
hi clear
let g:colors_name = "hackertheme"

hi Normal guifg=#00ff00 guibg=NONE
hi Comment guifg=#D1D1D1 gui=italic
hi String guifg=#FFF066
hi Function guifg=#9DE0AD
hi Keyword guifg=#A9D0F5 gui=italic
hi Operator guifg=#FFDCA2 gui=bold
hi Number guifg=#EFF0EB gui=bold
hi Boolean guifg=#86E3CE

Three lines of housekeeping do real work:

  • set background=dark tells plugins and built-in groups which variant to assume.
  • hi clear resets everything to defaults, so your theme starts from a known state instead of layering over whatever was active.
  • g:colors_name must match the file name — it is how Neovim tracks the active scheme.

guibg=NONE on Normal keeps your terminal’s own background (including transparency) instead of painting over it.

Loading it

colorscheme hackertheme

Add that line to your config and the theme survives restarts. The exact file above ships with the course repository — see the course companion repo under stages/10-neovim-switch/colors/.