.dotfiles

Neovim Style Guide Configuration

This document summarizes the coding style standards configured in Neovim, following industry-standard style guides.

Language-Specific Settings

All settings are automatically applied when opening files of the corresponding type.

Languages with 2-Space Indentation

Language Style Guide Column Limit Notes
C/C++ Industry standard 100 Includes .c, .cpp, .cc, .h, .hpp
Shell/Bash Industry standard 100 Includes sh, bash, zsh, fish
JavaScript/TypeScript Industry standard 100 Includes JSX/TSX, JSON
HTML/CSS Industry standard 100 Includes SCSS, SASS, LESS
Swift Industry standard 100 Common convention
Lua Industry standard 100 Common convention
LaTeX Industry standard 100 With word wrap enabled
Ruby Industry standard 100 Rails convention
YAML/TOML Industry standard - Configuration files
Markdown Industry standard 100 With word wrap enabled

Languages with 4-Space Indentation

Language Style Guide Column Limit Notes
Python PEP 8 standard 100 Industry convention
Rust Official Rust Style 100 rustfmt default

Languages with Tab Indentation

Language Style Guide Notes
Go Official Go Style gofmt enforced
Makefile Required by syntax Tabs are mandatory

Key Features

  1. Automatic Detection: File type is automatically detected and appropriate settings are applied
  2. Column Indicators: Visual guides at 80 or 100 characters (language-dependent)
  3. Smart Indentation: Proper indent levels maintained when pressing Enter
  4. Spaces vs Tabs: Automatically configured per language (spaces for most, tabs for Go/Make)

LSP Integration

Language servers are configured to respect these settings:

Manual Override

To temporarily override settings for the current buffer:

:setlocal shiftwidth=4 tabstop=4

To check current settings:

:set shiftwidth? tabstop? expandtab?

Format Command

Use the :Format command or the fixy shell script to automatically format files according to these standards.

Python Linting

The Google Python Style Guide pylintrc is available at styleguide/pylintrc. This provides:

Run pylint using the Google style guide:

pylint --rcfile=~/.dotfiles/styleguide/pylintrc myfile.py

The fixy script will automatically run pylint if it’s installed.