Posts

Showing posts from May, 2023

How to use vim as your IDE

Image
Vim can be transformed into a powerful Integrated Development Environment (IDE) through the use of plugins and custom configurations. In this article we are going to use the latter to allow you to compile a project from vim Once you are able to compile your code without having to leave the vim window, you can say that vim is your IDE. However, in order to do so, you will need to use a powerful vim feature called the Location List. It is a small window that pops up at the bottom of the current window, and we are going to use it for displaying the compilation result. If there are compilation errors, we will be able to navigate directly to them from the Location List window. First, we need to setup the command that we are going to use for compiling the source code. For example, we can use nmake to compile a project in Windows: set makeprg=nmake Vim comes with some predefined patterns for the error formats of the compilers, so that vim can parse them and navigate from the err

Best git alias list

Image
In this article we are going to see how to use powerful git aliases that can help you navigate through huge code baselines Aliases in Git provide a convenient way to create shortcuts for frequently used Git commands. They allow users to define their own custom commands or abbreviations for longer and complex Git operations, making them easier to remember and execute. With aliases, users can create shortcuts for commands like committing changes, pushing to remote repositories, branching, merging, and more. These custom aliases can be defined in the Git configuration file or through the command line. By using aliases, developers can significantly enhance their productivity by reducing the amount of typing required and streamlining their Git workflow. Additionally, aliases can be shared among team members, ensuring consistent and efficient Git usage across projects. Overall, aliases in Git provide a flexible and personalized way to simplify and speed up common Git operations. FILES

How to use windows, tabs and buffers in vim

Image
In Vim, buffers, windows, and tabs are essential concepts that help users efficiently manage and navigate multiple files and views within the editor Together, buffers, windows, and tabs in Vim offer a powerful and flexible environment for editing and navigating files. Users can switch between buffers, resize and rearrange windows, and create new tabs to suit their workflow. These features enable efficient multitasking and enhance productivity when working with multiple files or different sections of code. Buffers represent the opened files or text contents in Vim. Each file being edited is stored in a separate buffer, which allows users to switch between different files quickly. Buffers can be created, modified, saved, and closed, providing flexibility and control over the editing process. Windows , on the other hand, refer to the split views within the Vim editor. Users can split the Vim window horizontally or vertically, creating multiple windows to display different buffers si

How to use vim horizonal movements

Image
Horizontal movements in Vim refer to the navigation and movement commands that allow users to traverse the text horizontally within the editor As stated in the article  [vim - Vertical movements]  the best way to learn how to use vim horizontal movements is to disable the arrows and pageUp/pageDown keys. Vim provides a range of commands for moving the cursor left or right by characters, words, or specific positions within a line. They provide users with precise control over their cursor position, allowing for efficient navigation, editing, and manipulation of text within the editor. The horizontal movements can be divided into several categories depending on the level of movement that you are going to perform: Words : each sequence of characters up to a special character is considered a word Blocks of text : each sequence of characters up to a white space is considered a block Occurrence : find an occurrence of a specific character from the cursor position Character : move only on

How to use vim vertical movements

Image
Vertical movements in Vim refer to the commands and techniques used to navigate and move the cursor up and down within the editor Vim offers various commands to facilitate vertical movement, allowing users to efficiently traverse through lines, paragraphs, and larger blocks of text. They enable users to swiftly navigate through their code or text, making it easier to locate specific sections, review content, or perform targeted editing tasks. The best way to learn how to use the vim movements is to disable the arrows and PageUp/PageDown keys. That way, you will force yourself to use the vim key combinations to move around. These are the instructions that you can add to your .vimrc to disable those keys: " DISABLE Arrows keys and PageUp/PageDown noremap <Up> <Nop> noremap <Down> <Nop> noremap <Left> <Nop> noremap <Right> <Nop> noremap <PageUp> <Nop> noremap <PageDown> <Nop> Apart