From 8adb6bdd2628e6c7755c466f77dcf7faaefe5b9c Mon Sep 17 00:00:00 2001 From: leoberbert Date: Fri, 29 Nov 2024 16:56:58 -0300 Subject: [PATCH] fix: Configuration adjustment. --- README.md | 55 ++++++++++++++++++---------- etc/vimrc | 18 ++++++--- pkgbuild/biglinux-vim-config.install | 16 +++++++- 3 files changed, 62 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 4fa0c0e..4cb5df8 100644 --- a/README.md +++ b/README.md @@ -5,25 +5,35 @@ This repository contains a custom Vim configuration designed to enhance usabilit ## Features - **Search and Encoding**: - - Highlights all matches in search results. + - Highlights all matches in search results (`hlsearch`). - Ignores case in search patterns (`ignorecase`). - - Sets file encoding to UTF-8. - - Disables incremental search (`noincsearch`). + - 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 if available. + - 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. + - **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 if idle for a defined period. - - Automatically applies filetype-specific indentation. + - Exits Insert mode automatically if idle for a defined period (`CursorHoldI`). + - Applies filetype-specific indentation settings when opening files. - **Status Line**: - - Displays file information, working directory, and cursor position. + - Displays detailed information, including file name, working directory, cursor position, and more. ## Configuration Details @@ -32,14 +42,19 @@ syntax on filetype plugin indent on " Search and encoding settings -set noincsearch " Disables incremental search -set ignorecase " Ignores case in search patterns -set encoding=utf8 " Sets file encoding to UTF-8 -set laststatus=2 " Always display the status line -set hlsearch " Highlights all matches in search results -set showmatch " Highlights matching parenthesis/brackets - -" Mouse support +set noincsearch " Disables incremental search; highlights only on Enter +set ignorecase " Ignores case in search patterns for easier matching +set encoding=utf8 " Sets file encoding to UTF-8 for better compatibility +set laststatus=2 " Always displays the status line at the bottom of the screen +set hlsearch " Highlights all matches for search results to improve visibility +set showmatch " Briefly highlights matching parentheses, brackets, or braces +set cursorline " Highlights the entire line where the cursor is positioned for better focus +set nocompatible " Ensures Vim is not in Vi mode + +" Color Scheme +colorscheme codedark + +" Enables mouse support if available if has("mouse") set mouse=v " Enables mouse support in visual mode endif @@ -64,8 +79,8 @@ autocmd FileType html call HtmlConfig() autocmd FileType python call PythonConfig() autocmd FileType yaml,yml call YamlConfig() -" Status line +" Status line configuration set statusline=\ File:\ %F%m%r%h\ %w\ \ Working\ Directory:\ %r%{getcwd()}%h\ -\ Line:\ %l\ -\ Column:\ %c " Prevent defaults.vim from overwriting these settings -let g:skip_defaults_vim = 1 +let g:skip_defaults_vim = 1 \ No newline at end of file diff --git a/etc/vimrc b/etc/vimrc index b89fb04..b0f7474 100755 --- a/etc/vimrc +++ b/etc/vimrc @@ -2,12 +2,18 @@ syntax on filetype plugin indent on " Search and encoding settings -set noincsearch " Disables incremental search; highlights only on Enter -set ignorecase " Ignores case in search patterns -set encoding=utf8 " Sets file encoding to UTF-8 -set laststatus=2 " Always display the status line at the bottom -set hlsearch " Highlights all matches in search results -set showmatch + +set noincsearch " Disables incremental search; matches are only highlighted after pressing Enter +set ignorecase " Ignores case in search patterns for easier matching +set encoding=utf8 " Sets file encoding to UTF-8 for better compatibility +set laststatus=2 " Always displays the status line at the bottom of the screen +set hlsearch " Highlights all matches for search results to improve visibility +set showmatch " Briefly highlights matching parentheses, brackets, or braces +set cursorline " Highlights the entire line where the cursor is positioned for better focus +set nocompatible " Ensures Vim is not in Vi mode + +"Color Scheme +colorscheme codedark " Enables mouse support if available if has("mouse") diff --git a/pkgbuild/biglinux-vim-config.install b/pkgbuild/biglinux-vim-config.install index ada4397..43aae4a 100644 --- a/pkgbuild/biglinux-vim-config.install +++ b/pkgbuild/biglinux-vim-config.install @@ -10,6 +10,16 @@ post_install() { if [ -f /etc/vimrc.new ]; then mv -f /etc/vimrc.new /etc/vimrc fi + # Check if the directory for plugins exists, create if it doesn't + if [ ! -d /usr/share/vim/vimfiles/pack/git-plugins/start ]; then + mkdir -p /usr/share/vim/vimfiles/pack/git-plugins/start + fi + # Clone vim-code-dark repository if it doesn't already exist + if [ ! -d /usr/share/vim/vimfiles/pack/git-plugins/start/vim-code-dark ]; then + git clone https://github.com/tomasiser/vim-code-dark /usr/share/vim/vimfiles/pack/git-plugins/start/vim-code-dark + fi + # Set appropriate permissions + chmod -R a+rx /usr/share/vim/vimfiles/pack/git-plugins/start/vim-code-dark } # Restore the original file @@ -17,4 +27,8 @@ post_remove() { if [ -f /etc/vimrc.bkp ]; then mv -f /etc/vimrc.bkp /etc/vimrc fi -} + # Remove the plugin directory if it is empty + if [ -d /usr/share/vim/vimfiles/pack/git-plugins ]; then + rm -rf /usr/share/vim/vimfiles/pack/git-plugins + fi +} \ No newline at end of file