Skip to content

Latest commit

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Vim Configuration

This repository contains a custom Vim configuration designed to enhance usability, provide flexible indentation settings for various file types, and improve the overall coding experience.

Features

  • Search and Encoding:

    • Highlights all matches in search results (hlsearch).
    • Ignores case in search patterns (ignorecase).
    • Disables incremental search, highlighting matches only after pressing Enter (noincsearch).
    • Sets file encoding to UTF-8 (encoding=utf8).
    • Always displays the status line at the bottom of the screen (laststatus=2).
  • Mouse Support:

    • Enables mouse functionality in visual mode (set mouse=v), if supported.
  • Cursor Highlighting:

    • Highlights the entire line where the cursor is positioned for better focus (cursorline).
  • Vi Compatibility:

    • Ensures Vim is not in compatibility mode with Vi, enabling modern features (nocompatible).
  • Color Scheme:

    • Sets the color scheme to codedark for a modern look.
  • Filetype-Specific Indentation:

    • HTML: 2 spaces for tabs and indentation.
    • Python: 4 spaces for tabs and indentation.
    • YAML: 2 spaces for tabs and indentation with custom indent keys.
  • Autocommands:

    • Exits Insert mode automatically if idle for a defined period (CursorHoldI).
    • Applies filetype-specific indentation settings when opening files.
  • Status Line:

    • Displays detailed information, including file name, working directory, cursor position, and more.

Configuration Details

syntaxonfiletypepluginindenton" Search and encoding settingssetnoincsearch" Disables incremental search; highlights only on Entersetignorecase" Ignores case in search patterns for easier matchingsetencoding=utf8" Sets file encoding to UTF-8 for better compatibilitysetlaststatus=2" Always displays the status line at the bottom of the screensethlsearch" Highlights all matches for search results to improve visibilitysetshowmatch" Briefly highlights matching parentheses, brackets, or bracessetcursorline" Highlights the entire line where the cursor is positioned for better focussetnocompatible" Ensures Vim is not in Vi mode" Color Schemecolorscheme codedark
" Enables mouse support if availableifhas("mouse")
setmouse=v" Enables mouse support in visual modeendif" Filetype-specific indentationfunctionHtmlConfig()
settabstop=2softtabstop=2expandtabshiftwidth=2endfunctionfunctionPythonConfig()
settabstop=4softtabstop=4expandtabshiftwidth=4endfunctionfunctionYamlConfig()
settabstop=2softtabstop=2expandtabshiftwidth=2setindentkeys-=0# indentkeys-=<:>endfunction" AutocommandsautocmdCursorHoldI*stopinsert" Exit Insert mode if idleautocmdFileTypehtmlcallHtmlConfig()
autocmdFileTypepythoncallPythonConfig()
autocmdFileTypeyaml,ymlcallYamlConfig()
" Status line configurationsetstatusline=\ File:\ %F%m%r%h\ %w\ \ Working\ Directory:\ %r%{getcwd()}%h\ -\ Line:\ %l\ -\ Column:\ %c" Prevent defaults.vim from overwriting these settingsletg:skip_defaults_vim=1

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages