A limitation of kicad is that one can not add an empty lib to the fp-lib-table. (Some versions of kicad crash if they encounter an empty lib)
The standard workflow for creating a new footprint lib from within kicad is as follows:
Starting completely from scratch
- Click the button "new footprint" (also found under the file menu entry)
- Give your new footprint the desired name
- Save your footprint to a new lib via the button in the top toolbar or again via the entry in the file menu. (Save footprint in new library)
- Select the location and name of your new lib. (The ending .pretty will be added automatically if you omit it.)
- Add your lib to either the global or local fp-lib-table using the library wizard. (preferences->footprint library wizard.)
- in the first page select "Files on my computer"
- Second page is where you navigate to your new lib
- Last page is where you select global or project local fp lib table.
- Local means only visible in the current project, global of course is visible in all your projects.
- If you use global, be aware that users with whom you share your project also need to add the libs to their config. (happens automatically with project local fp lib table entries.)
- If you want to use path variables you need to use the footprint library manager (also found in the preferences menu)
- There you can first append the lib with the wizard and afterwards edit the path to include your environment variable. Syntax:
- Set your new lib as active as usual. (File menu or top left button in the top toolbar)
- Create your footprint as desired.
Starting from an existing footprint
- Open the footprint you want to copy
- Option 1: Via the footprint browser
- Click the "open footprint from library" button (you don't need an active lib for this to work)
- Click select by browser
- Option 2: list all footprints of a lib and select from there (with text filter)
- Set the lib containing your footprint as active
- Click the "open footprint from library" button
- Click "List all"
- The opened dialog lists all footprints available in the active lib (in all libs in none is active) Use the text field to filter by footprint name
- Use "save footprint to new lib" to create your new library containing this footprint.
- Sadly you can only specify the lib name not a new name for the footprint
- Renaming the footprint can only be done after you have your new lib as active lib. (use the save footprint in lib button to save it under a new name. And use the delete footprint dialog to delete the old footprint.)
- Follow the steps 3 to 7 from the "From Scratch" workflow.
You can also use the file browser of your operating system and a text editor to get to the same result.
- Navigate to the .pretty directory containing your source footprint.
- Copy the footprint(s) you want in your new lib
- Navigate to the directory to which you want to add your footprint libraries (Make sure it is one where your user has write access)
- Create a new folder (or directory) with name:
- Paste your footprint(s)
- If you want you can now rename the footprints using the file browser (remember to also change the fp-name within the file using a text editor)
- Add the lib to kicad as explained in step 5 of the "From scratch workflow"